diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-08-14 07:24:45 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2019-08-14 07:24:45 (GMT) |
commit | 6e2f02a5a6a694d1c1ad853307791acf1fd85c92 (patch) | |
tree | 7d98f24bc0e1f58d9bf18be980e4d1cbc157947e /generic/tclCmdMZ.c | |
parent | 20bd9d9cabc9db212abbaf9d4dbb18eb490e9f71 (diff) | |
parent | c9376306301e578615cfee52d2121f78cb31a225 (diff) | |
download | tcl-6e2f02a5a6a694d1c1ad853307791acf1fd85c92.zip tcl-6e2f02a5a6a694d1c1ad853307791acf1fd85c92.tar.gz tcl-6e2f02a5a6a694d1c1ad853307791acf1fd85c92.tar.bz2 |
Merge 8.7
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r-- | generic/tclCmdMZ.c | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index 6fba4c6..c413780 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -4188,7 +4188,6 @@ Tcl_TimeRateObjCmd( }; NRE_callback *rootPtr; ByteCode *codePtr = NULL; - int codeOptimized = 0; for (i = 1; i < objc - 1; i++) { int index; @@ -4373,15 +4372,6 @@ Tcl_TimeRateObjCmd( } codePtr = TclCompileObj(interp, objPtr, NULL, 0); TclPreserveByteCode(codePtr); - /* - * Replace last compiled done instruction with continue: it's a part of - * iteration, this way evaluation will be more similar to a cycle (also - * avoids extra overhead to set result to interp, etc.) - */ - if (codePtr->codeStart[codePtr->numCodeBytes-1] == INST_DONE) { - codePtr->codeStart[codePtr->numCodeBytes-1] = INST_CONTINUE; - codeOptimized = 1; - } } /* @@ -4423,6 +4413,12 @@ Tcl_TimeRateObjCmd( count++; if (!direct) { /* precompiled */ rootPtr = TOP_CB(interp); + /* + * Use loop optimized TEBC call (TCL_EVAL_DISCARD_RESULT): it's a part of + * iteration, this way evaluation will be more similar to a cycle (also + * avoids extra overhead to set result to interp, etc.) + */ + ((Interp *)interp)->evalFlags |= TCL_EVAL_DISCARD_RESULT; result = TclNRExecuteByteCode(interp, codePtr); result = TclNRRunCallbacks(interp, result, rootPtr); } else { /* eval */ @@ -4675,11 +4671,6 @@ Tcl_TimeRateObjCmd( done: if (codePtr != NULL) { - if ( codeOptimized - && codePtr->codeStart[codePtr->numCodeBytes-1] == INST_CONTINUE - ) { - codePtr->codeStart[codePtr->numCodeBytes-1] = INST_DONE; - } TclReleaseByteCode(codePtr); } return result; |