summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2005-04-01 16:18:32 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2005-04-01 16:18:32 (GMT)
commit5950047f06d1ebff15c5829817ec1ba437dacc60 (patch)
tree5a831a5ccc15f8b67b722dfd14a290467a48a3a7 /generic/tclExecute.c
parent67eadc7d6cf028cb746dd535f431bc5d655ea6a5 (diff)
downloadtcl-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.
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c15
1 files changed, 11 insertions, 4 deletions
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);
}