diff options
author | mig <mig> | 2011-03-01 19:54:54 (GMT) |
---|---|---|
committer | mig <mig> | 2011-03-01 19:54:54 (GMT) |
commit | ad4787470445d29656797ce0f19af1ad478eb4e2 (patch) | |
tree | de9c73c4a60bfd332bded0a6a1e50acb0c703d96 /generic/tclExecute.c | |
parent | d21c0a8aa8925c53e28bd8150874092356620f65 (diff) | |
download | tcl-ad4787470445d29656797ce0f19af1ad478eb4e2.zip tcl-ad4787470445d29656797ce0f19af1ad478eb4e2.tar.gz tcl-ad4787470445d29656797ce0f19af1ad478eb4e2.tar.bz2 |
This is [Patch 3168398], Joe Mistachkin's optimisation of Tip #285
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r-- | generic/tclExecute.c | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index aa0c8b7..d34b364 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -2080,10 +2080,6 @@ TEBCresume( * stack. */ const unsigned char *pc; /* The current program counter. */ -#ifdef TCL_COMPILE_DEBUG - traceInstructions = (tclTraceExec == 3); -#endif - /* * Transfer variables - needed only between opcodes, but not while * executing an instruction. @@ -2100,12 +2096,17 @@ TEBCresume( Tcl_Obj *objPtr, *valuePtr, *value2Ptr, *part1Ptr, *part2Ptr, *tmpPtr; Tcl_Obj **objv; - int opnd, objc, length, pcAdjustment; + int objc = 0; + int opnd, length, pcAdjustment; Var *varPtr, *arrayPtr; #ifdef TCL_COMPILE_DEBUG char cmdNameBuf[21]; #endif +#ifdef TCL_COMPILE_DEBUG + traceInstructions = (tclTraceExec == 3); +#endif + NR_DATA_DIG(); #ifdef TCL_COMPILE_DEBUG @@ -2280,9 +2281,11 @@ TEBCresume( } } - if (Tcl_Canceled(interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR) { - CACHE_STACK_INFO(); - goto gotError; + if (TclCanceled(iPtr)) { + if (Tcl_Canceled(interp, TCL_LEAVE_ERR_MSG) == TCL_ERROR) { + CACHE_STACK_INFO(); + goto gotError; + } } if (TclLimitReady(iPtr->limit)) { @@ -6303,7 +6306,7 @@ TEBCresume( * already be set prior to vectoring down to this point in the code. */ - if (Tcl_Canceled(interp, 0) == TCL_ERROR) { + if (TclCanceled(iPtr) && (Tcl_Canceled(interp, 0) == TCL_ERROR)) { #ifdef TCL_COMPILE_DEBUG if (traceInstructions) { fprintf(stdout, " ... cancel with unwind, returning %s\n", |