diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2005-04-01 16:18:32 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2005-04-01 16:18:32 (GMT) |
commit | 5950047f06d1ebff15c5829817ec1ba437dacc60 (patch) | |
tree | 5a831a5ccc15f8b67b722dfd14a290467a48a3a7 | |
parent | 67eadc7d6cf028cb746dd535f431bc5d655ea6a5 (diff) | |
download | tcl-5950047f06d1ebff15c5829817ec1ba437dacc60.zip tcl-5950047f06d1ebff15c5829817ec1ba437dacc60.tar.gz tcl-5950047f06d1ebff15c5829817ec1ba437dacc60.tar.bz2 |
* generic/tclExecute.c:
* generic/tclInt.h: ExecEnv now stores two Tcl_Obj* pointing to
the constants "0" and "1", for use by TEBC.
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | generic/tclExecute.c | 15 | ||||
-rw-r--r-- | generic/tclInt.h | 3 |
3 files changed, 19 insertions, 5 deletions
@@ -1,6 +1,12 @@ 2005-04-01 Miguel Sofer <msofer@users.sf.net> * generic/tclExecute.c: + * generic/tclInt.h: ExecEnv now stores two Tcl_Obj* pointing to + the constants "0" and "1", for use by TEBC. + +2005-04-01 Miguel Sofer <msofer@users.sf.net> + + * generic/tclExecute.c: * generic/tclInt.h: * generic/tclObj.c: * generic/tclStringObj.c: defined new internal macros for creating diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 78446c0..6953ff5 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.174 2005/04/01 15:17:21 msofer Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.175 2005/04/01 16:18:55 msofer Exp $ */ #include "tclInt.h" @@ -521,6 +521,11 @@ TclCreateExecEnv(interp) eePtr->tosPtr = stackPtr - 1; eePtr->endPtr = stackPtr + (TCL_STACK_INITIAL_SIZE - 2); + TclNewIntObj(eePtr->constants[0], 0); + Tcl_IncrRefCount(eePtr->constants[0]); + TclNewIntObj(eePtr->constants[1], 1); + Tcl_IncrRefCount(eePtr->constants[1]); + Tcl_MutexLock(&execMutex); if (!execInitialized) { TclInitAuxDataTypeTable(); @@ -559,6 +564,8 @@ TclDeleteExecEnv(eePtr) } else { Tcl_Panic("ERROR: freeing an execEnv whose stack is still in use.\n"); } + TclDecrRefCount(eePtr->constants[0]); + TclDecrRefCount(eePtr->constants[1]); ckfree((char *) eePtr); } @@ -3093,7 +3100,7 @@ TclExecuteByteCode(interp, codePtr) NEXT_INST_F((iResult? TclGetInt4AtPtr(pc+1) : 5), 2, 0); } #endif - TclNewIntObj(objResultPtr, iResult); + objResultPtr = eePtr->constants[iResult]; NEXT_INST_F(0, 2, 1); } @@ -3288,7 +3295,7 @@ TclExecuteByteCode(interp, codePtr) TRACE(("%.20s %.20s => %d\n", O2S(valuePtr), O2S(value2Ptr), match)); if (Tcl_IsShared(value2Ptr)) { - TclNewIntObj(objResultPtr, match); + objResultPtr = eePtr->constants[match]; NEXT_INST_F(2, 2, 1); } else { /* reuse the valuePtr object */ TclSetIntObj(value2Ptr, match); @@ -3572,7 +3579,7 @@ TclExecuteByteCode(interp, codePtr) NEXT_INST_F((iResult? TclGetInt4AtPtr(pc+1) : 5), 2, 0); } #endif - TclNewIntObj(objResultPtr, iResult); + objResultPtr = eePtr->constants[iResult]; NEXT_INST_F(0, 2, 1); } diff --git a/generic/tclInt.h b/generic/tclInt.h index 756fdee..4521ff4 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.217 2005/04/01 15:17:24 msofer Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.218 2005/04/01 16:18:59 msofer Exp $ */ #ifndef _TCLINT @@ -956,6 +956,7 @@ typedef struct ExecEnv { 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; /* |