summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2010-04-30 09:23:05 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2010-04-30 09:23:05 (GMT)
commit328ed1ee2f70e62534308b6f630d1c53217538c4 (patch)
tree753cd9e3c496a3a5ea4c8448116c6b79f6d1406b
parent6607ab8ad1c496eb51f08a16d337a4c4e24c991d (diff)
downloadtcl-328ed1ee2f70e62534308b6f630d1c53217538c4.zip
tcl-328ed1ee2f70e62534308b6f630d1c53217538c4.tar.gz
tcl-328ed1ee2f70e62534308b6f630d1c53217538c4.tar.bz2
* generic/tclCompCmds.c (TclCompileVariableCmd): Slightly tighter
issuing of instructions.
-rw-r--r--ChangeLog3
-rw-r--r--generic/tclCompCmds.c10
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index de68e01..2cd03e5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2010-04-30 Donal K. Fellows <dkf@users.sf.net>
+ * generic/tclCompCmds.c (TclCompileVariableCmd): Slightly tighter
+ issuing of instructions.
+
* generic/tclExecute.c (TclExecuteByteCode): Add peephole optimization
of the fact that INST_DICT_FIRST and INST_DICT_NEXT always have a
conditional jump afterwards.
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);
}
}