summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorandreas_kupries <akupries@shaw.ca>2009-07-14 16:33:12 (GMT)
committerandreas_kupries <akupries@shaw.ca>2009-07-14 16:33:12 (GMT)
commit06eaea4df70451d16154d922e94eaba288cc8839 (patch)
treef52fafcaabff986052846ac6eeb3fb691118e600 /generic/tclExecute.c
parent96886634efaa755005489a262696057f0611f32f (diff)
downloadtcl-06eaea4df70451d16154d922e94eaba288cc8839.zip
tcl-06eaea4df70451d16154d922e94eaba288cc8839.tar.gz
tcl-06eaea4df70451d16154d922e94eaba288cc8839.tar.bz2
* generic/tclBasic.c (DeleteInterpProc,TclArgumentBCEnter,
TclArgumentBCRelease, TclArgumentGet): * generic/tclCompile.c (EnterCmdWordIndex, TclCleanupByteCode, TclInitCompileEnv, TclCompileScript): * generic/tclCompile.h (ExtCmdLoc): * generic/tclExecute.c (TclExecuteByteCode): * generic/tclInt.h (ExtIndex, CFWordBC): * tests/info.test (info-39.0): Backport of some changes made to the Tcl head, to handle literal sharing better. The code here is much simpler (trimmed down) compared to the head as the 8.5 branch is not bytecode compiling whole files, and doesn't compile eval'd code either. Reworked the handling of literal command arguments in bytecode to be saved (compiler) and used (execution) per command (See the TCL_INVOKE_STK* instructions), and not per the whole bytecode. This removes the problems with location data caused by literal sharing in proc bodies. Simplified the associated datastructures (ExtIndex is gone, as is the function EnterCmdWordIndex).
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index a63508e..7974db5 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclExecute.c,v 1.369.2.11 2009/07/01 15:29:48 patthoyts Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.369.2.12 2009/07/14 16:33:12 andreas_kupries Exp $
*/
#include "tclInt.h"
@@ -1730,8 +1730,6 @@ TclExecuteByteCode(
bcFramePtr->cmd.str.cmd = NULL;
bcFramePtr->cmd.str.len = 0;
- TclArgumentBCEnter((Tcl_Interp*) iPtr,codePtr,bcFramePtr);
-
#ifdef TCL_COMPILE_DEBUG
if (tclTraceExec >= 2) {
PrintByteCodeInfo(codePtr);
@@ -2322,10 +2320,16 @@ TclExecuteByteCode(
bcFramePtr->data.tebc.pc = (char *) pc;
iPtr->cmdFramePtr = bcFramePtr;
+ TclArgumentBCEnter((Tcl_Interp*) iPtr, objv, objc,
+ codePtr, bcFramePtr,
+ pc - codePtr->codeStart);
DECACHE_STACK_INFO();
result = TclEvalObjvInternal(interp, objc, objv,
/* call from TEBC */(char *) -1, -1, 0);
CACHE_STACK_INFO();
+ TclArgumentBCRelease((Tcl_Interp*) iPtr, objv, objc,
+ codePtr,
+ pc - codePtr->codeStart);
iPtr->cmdFramePtr = iPtr->cmdFramePtr->nextPtr;
if (result == TCL_OK) {
@@ -7401,8 +7405,6 @@ TclExecuteByteCode(
}
}
- TclArgumentBCRelease((Tcl_Interp*) iPtr,codePtr);
-
/*
* Restore the stack to the state it had previous to this bytecode.
*/