diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2007-06-05 17:50:54 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2007-06-05 17:50:54 (GMT) |
commit | 68919c24042c4dd2b585f557d98d6bea70fa1cf4 (patch) | |
tree | 1f976d89b85ff7dff5fb7bb622bf9d6483857fd9 /generic/tclInt.h | |
parent | 5594bcf588c8acb2d6c163b67922d08038ab785c (diff) | |
download | tcl-68919c24042c4dd2b585f557d98d6bea70fa1cf4.zip tcl-68919c24042c4dd2b585f557d98d6bea70fa1cf4.tar.gz tcl-68919c24042c4dd2b585f557d98d6bea70fa1cf4.tar.bz2 |
* generic/tclInt.h:
* generic/tclExecute.c: Tcl-stack reform, [Patch 1701202]
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r-- | generic/tclInt.h | 26 |
1 files changed, 18 insertions, 8 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h index ec0fd19..b9c8f3a 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInt.h,v 1.311 2007/05/30 18:12:58 dgp Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.312 2007/06/05 17:50:56 msofer Exp $ */ #ifndef _TCLINT @@ -1183,20 +1183,30 @@ typedef int (CompileHookProc) (Tcl_Interp *interp, struct CompileEnv *compEnvPtr, ClientData clientData); /* + * The data structure for a (linked list of) execution stacks. + */ + +typedef struct ExecStack { + struct ExecStack *prevPtr; + struct ExecStack *nextPtr; + Tcl_Obj **markerPtr; + Tcl_Obj **endPtr; + Tcl_Obj **tosPtr; + Tcl_Obj *stackWords[1]; +} ExecStack; + + +/* * The data structure defining the execution environment for ByteCode's. * There is one ExecEnv structure per Tcl interpreter. It holds the evaluation * stack that holds command operands and results. The stack grows towards - * increasing addresses. The "stackTop" member is cached by TclExecuteByteCode - * in a local variable: it must be set before calling TclExecuteByteCode and - * will be restored by TclExecuteByteCode before it returns. + * increasing addresses. The member stackPtr points to the stackItems of the + * currently active execution stack. */ typedef struct ExecEnv { - Tcl_Obj **stackPtr; /* Points to the first item in the evaluation + ExecStack *execStackPtr; /* Points to the first item in the evaluation * stack on the heap. */ - Tcl_Obj **tosPtr; /* Points to current top of stack; - * (stackPtr-1) when the stack is empty. */ - Tcl_Obj **endPtr; /* Points to last usable item in stack. */ Tcl_Obj *constants[2]; /* Pointers to constant "0" and "1" objs. */ } ExecEnv; |