summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authormig <mig>2013-01-11 15:37:10 (GMT)
committermig <mig>2013-01-11 15:37:10 (GMT)
commit496f711ae9cf8d67deb17e52f10b5b3ae39646f7 (patch)
tree68f3d68ab6de9e7364ac9b5d43f3ed1cf0b5546d /generic/tclExecute.c
parent0c2d5031a205445ac91209816f31a8a943b3921a (diff)
downloadtcl-496f711ae9cf8d67deb17e52f10b5b3ae39646f7.zip
tcl-496f711ae9cf8d67deb17e52f10b5b3ae39646f7.tar.gz
tcl-496f711ae9cf8d67deb17e52f10b5b3ae39646f7.tar.bz2
testing a cheaper(?) INST_START_COMMAND
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c97
1 files changed, 48 insertions, 49 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 303bafd..ae9d0c7 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -2309,6 +2309,18 @@ TEBCresume(
* reduces total obj size.
*/
+ if (*pc == INST_START_CMD) {
+ iPtr->cmdCount += TclGetUInt4AtPtr(pc+5);
+ if (checkInterp) {
+ checkInterp = 0;
+ if ((codePtr->compileEpoch != iPtr->compileEpoch)
+ || (codePtr->nsEpoch != iPtr->varFramePtr->nsPtr->resolverEpoch)) {
+ goto instStartCmdFailed;
+ }
+ }
+ pc += 9;
+ }
+
if (*pc == INST_LOAD_SCALAR1) {
goto instLoadScalar1;
} else if (*pc == INST_PUSH1) {
@@ -2499,57 +2511,8 @@ TEBCresume(
*/
pc++;
-#if !TCL_COMPILE_DEBUG
- if (*pc == INST_START_CMD) {
- TCL_DTRACE_INST_NEXT();
- goto instStartCmdPeephole;
- }
-#endif
NEXT_INST_F(0, 0, 0);
- case INST_START_CMD:
-#if !TCL_COMPILE_DEBUG
- instStartCmdPeephole:
-#endif
- /*
- * Remark that if the interpreter is marked for deletion its
- * compileEpoch is modified, so that the epoch check also verifies
- * that the interp is not deleted. If no outside call has been made
- * since the last check, it is safe to omit the check.
- */
-
- iPtr->cmdCount += TclGetUInt4AtPtr(pc+5);
- if (!checkInterp) {
- goto instStartCmdOK;
- } else if (((codePtr->compileEpoch == iPtr->compileEpoch)
- && (codePtr->nsEpoch == iPtr->varFramePtr->nsPtr->resolverEpoch))
- || (codePtr->flags & TCL_BYTECODE_PRECOMPILED)) {
- checkInterp = 0;
- instStartCmdOK:
- NEXT_INST_F(9, 0, 0);
- } else {
- const char *bytes;
-
- length = 0;
-
- /*
- * We used to switch to direct eval; for NRE-awareness we now
- * compile and eval the command so that this evaluation does not
- * add a new TEBC instance. [Bug 2910748]
- */
-
- if (TclInterpReady(interp) == TCL_ERROR) {
- goto gotError;
- }
-
- codePtr->flags |= TCL_BYTECODE_RECOMPILE;
- bytes = GetSrcInfoForPc(pc, codePtr, &length, NULL);
- opnd = TclGetUInt4AtPtr(pc+1);
- pc += (opnd-1);
- PUSH_OBJECT(Tcl_NewStringObj(bytes, length));
- goto instEvalStk;
- }
-
case INST_NOP:
pc += 1;
goto cleanup0;
@@ -7102,6 +7065,42 @@ TEBCresume(
TclStackFree(interp, TD); /* free my stack */
return result;
+
+ /*
+ * INST_START_CMD failure case removed where it doesn't bother that much
+ */
+ /* case INST_START_CMD:
+ *
+ * Remark that if the interpreter is marked for deletion its
+ * compileEpoch is modified, so that the epoch check also verifies
+ * that the interp is not deleted. If no outside call has been made
+ * since the last check, it is safe to omit the check.
+ */
+
+ instStartCmdFailed:
+ {
+ const char *bytes;
+
+ length = 0;
+
+ /*
+ * We used to switch to direct eval; for NRE-awareness we now
+ * compile and eval the command so that this evaluation does not
+ * add a new TEBC instance. [Bug 2910748]
+ */
+
+ if (TclInterpReady(interp) == TCL_ERROR) {
+ goto gotError;
+ }
+
+ codePtr->flags |= TCL_BYTECODE_RECOMPILE;
+ bytes = GetSrcInfoForPc(pc, codePtr, &length, NULL);
+ opnd = TclGetUInt4AtPtr(pc+1);
+ pc += (opnd-1);
+ PUSH_OBJECT(Tcl_NewStringObj(bytes, length));
+ goto instEvalStk;
+ NEXT_INST_F(9, 0, 0);
+ }
}
#undef codePtr