summaryrefslogtreecommitdiffstats
path: root/generic/tclCompCmds.c
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2010-04-30 09:23:05 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2010-04-30 09:23:05 (GMT)
commitddc75a8e93d575235904037587c3e772f8c96400 (patch)
tree753cd9e3c496a3a5ea4c8448116c6b79f6d1406b /generic/tclCompCmds.c
parent24e16718fb60e1a29dfe2c5c6f0a240de327f172 (diff)
downloadtcl-ddc75a8e93d575235904037587c3e772f8c96400.zip
tcl-ddc75a8e93d575235904037587c3e772f8c96400.tar.gz
tcl-ddc75a8e93d575235904037587c3e772f8c96400.tar.bz2
* generic/tclCompCmds.c (TclCompileVariableCmd): Slightly tighter
issuing of instructions.
Diffstat (limited to 'generic/tclCompCmds.c')
-rw-r--r--generic/tclCompCmds.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c
index e96c196..473dcb4 100644
--- a/generic/tclCompCmds.c
+++ b/generic/tclCompCmds.c
@@ -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: tclCompCmds.c,v 1.168 2010/03/05 14:34:03 dkf Exp $
+ * RCS: @(#) $Id: tclCompCmds.c,v 1.169 2010/04/30 09:23:06 dkf Exp $
*/
#include "tclInt.h"
@@ -1699,6 +1699,7 @@ TclCompileForeachCmd(
infoPtr->loopCtTemp = loopCtTemp;
for (loopIndex = 0; loopIndex < numLists; loopIndex++) {
ForeachVarList *varListPtr;
+
numVars = varcList[loopIndex];
varListPtr = (ForeachVarList *) ckalloc((unsigned)
sizeof(ForeachVarList) + numVars*sizeof(int));
@@ -2162,6 +2163,7 @@ TclCompileIfCmd(
Tcl_Obj *boolObj = Tcl_NewStringObj(testTokenPtr[1].start,
testTokenPtr[1].size);
+
Tcl_IncrRefCount(boolObj);
code = Tcl_GetBooleanFromObj(NULL, boolObj, &boolVal);
TclDecrRefCount(boolObj);
@@ -3793,7 +3795,11 @@ TclCompileVariableCmd(
*/
CompileWord(envPtr, valueTokenPtr, interp, 1);
- TclEmitInstInt4(INST_STORE_SCALAR4, localIndex, envPtr);
+ if (localIndex < 0x100) {
+ TclEmitInstInt1(INST_STORE_SCALAR1, localIndex, envPtr);
+ } else {
+ TclEmitInstInt4(INST_STORE_SCALAR4, localIndex, envPtr);
+ }
TclEmitOpcode(INST_POP, envPtr);
}
}