summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2016-05-26 16:33:37 (GMT)
committerdgp <dgp@users.sourceforge.net>2016-05-26 16:33:37 (GMT)
commitfc6928c19cf817f90924816477e7646e3ab9ccb0 (patch)
tree6ddf2d9305ace4640bb64a5d4a33de08ca4fcb73
parent7934310e9e0c4d8136a7eb664890ea86eeb6b322 (diff)
downloadtcl-fc6928c19cf817f90924816477e7646e3ab9ccb0.zip
tcl-fc6928c19cf817f90924816477e7646e3ab9ccb0.tar.gz
tcl-fc6928c19cf817f90924816477e7646e3ab9ccb0.tar.bz2
Reduce to minimum set of TclResetRewriteEnsemble() calls.
-rw-r--r--generic/tclExecute.c2
-rw-r--r--generic/tclNamesp.c2
-rw-r--r--generic/tclOOMethod.c5
-rw-r--r--generic/tclProc.c2
4 files changed, 7 insertions, 4 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 61d75cb..67eabdb 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -2081,6 +2081,8 @@ TclNRExecuteByteCode(
* Push the callback for bytecode execution
*/
+ TclResetRewriteEnsemble(interp, 1);
+
TclNRAddCallback(interp, TEBCresume, TD, /* pc */ NULL,
/* cleanup */ INT2PTR(0), NULL);
return TCL_OK;
diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c
index 543e089..58a86d9 100644
--- a/generic/tclNamesp.c
+++ b/generic/tclNamesp.c
@@ -3362,7 +3362,6 @@ NRNamespaceEvalCmd(
- iPtr->ensembleRewrite.numInsertedObjs;
framePtr->objv = iPtr->ensembleRewrite.sourceObjs;
}
- TclResetRewriteEnsemble(interp, 1);
if (objc == 3) {
/*
@@ -3803,7 +3802,6 @@ NRNamespaceInscopeCmd(
- iPtr->ensembleRewrite.numInsertedObjs;
framePtr->objv = iPtr->ensembleRewrite.sourceObjs;
}
- TclResetRewriteEnsemble(interp, 1);
/*
* Execute the command. If there is just one argument, just treat it as a
diff --git a/generic/tclOOMethod.c b/generic/tclOOMethod.c
index 843f833..a311ddb 100644
--- a/generic/tclOOMethod.c
+++ b/generic/tclOOMethod.c
@@ -1458,6 +1458,11 @@ InvokeForwardMethod(
argObjs = InitEnsembleRewrite(interp, objc, objv, skip,
numPrefixes, prefixObjs, &len);
Tcl_NRAddCallback(interp, FinalizeForwardCall, argObjs, NULL, NULL, NULL);
+ /*
+ * NOTE: The combination of direct set of iPtr->lookupNsPtr and the use
+ * of the TCL_EVAL_NOERR flag results in an evaluation configuration
+ * very much like TCL_EVAL_INVOKE.
+ */
((Interp *)interp)->lookupNsPtr
= (Namespace *) contextPtr->oPtr->namespacePtr;
return TclNREvalObjv(interp, len, argObjs, TCL_EVAL_NOERR, NULL);
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 56d29a2..70178f4 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -1785,8 +1785,6 @@ TclNRInterpProcCore(
* Invoke the commands in the procedure's body.
*/
- TclResetRewriteEnsemble(interp, 1);
-
procPtr->refCount++;
codePtr = procPtr->bodyPtr->internalRep.twoPtrValue.ptr1;