diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2010-04-30 09:23:05 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2010-04-30 09:23:05 (GMT) |
commit | ddc75a8e93d575235904037587c3e772f8c96400 (patch) | |
tree | 753cd9e3c496a3a5ea4c8448116c6b79f6d1406b | |
parent | 24e16718fb60e1a29dfe2c5c6f0a240de327f172 (diff) | |
download | tcl-ddc75a8e93d575235904037587c3e772f8c96400.zip tcl-ddc75a8e93d575235904037587c3e772f8c96400.tar.gz tcl-ddc75a8e93d575235904037587c3e772f8c96400.tar.bz2 |
* generic/tclCompCmds.c (TclCompileVariableCmd): Slightly tighter
issuing of instructions.
-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | generic/tclCompCmds.c | 10 |
2 files changed, 11 insertions, 2 deletions
@@ -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); } } |