summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2010-09-28 15:20:17 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2010-09-28 15:20:17 (GMT)
commitf939b6c7e8e9053fe0c26c1c33379cd9fba0a241 (patch)
tree710c8ceda106eb0fe8a2d9160f7d562d023dad65 /generic/tclExecute.c
parentac52d425437796ab87c8ebef20c152b283f60d76 (diff)
downloadtcl-f939b6c7e8e9053fe0c26c1c33379cd9fba0a241.zip
tcl-f939b6c7e8e9053fe0c26c1c33379cd9fba0a241.tar.gz
tcl-f939b6c7e8e9053fe0c26c1c33379cd9fba0a241.tar.bz2
* generic/tclExecute.c: remove TEBCreturn() callback, the job can
be accomplished by TEBCresume()
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c43
1 files changed, 12 insertions, 31 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 705d836..2297492 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -14,7 +14,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.500 2010/09/27 20:16:30 msofer Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.501 2010/09/28 15:20:17 msofer Exp $
*/
#include "tclInt.h"
@@ -721,7 +721,6 @@ static Tcl_NRPostProc CopyCallback;
static Tcl_NRPostProc ExprObjCallback;
static Tcl_NRPostProc TEBCresume;
-static Tcl_NRPostProc TEBCreturn;
/*
* The structure below defines a bytecode Tcl object type to hold the
@@ -1939,13 +1938,9 @@ TclNRExecuteByteCode(
#endif
/*
- * Push the callbacks for
- * - exception handling and cleanup
- * - bytecode execution
+ * Push the callback for bytecode execution
*/
- TclNRAddCallback(interp, TEBCreturn, BP, NULL,
- NULL, NULL);
TclNRAddCallback(interp, TEBCresume, BP,
/*resume*/ INT2PTR(0), NULL, NULL);
@@ -1953,26 +1948,6 @@ TclNRExecuteByteCode(
}
static int
-TEBCreturn(
- ClientData data[],
- Tcl_Interp *interp,
- int result)
-{
- BottomData *BP = data[0];
- ByteCode *codePtr = BP->codePtr;
-
- if (--codePtr->refCount <= 0) {
- TclCleanupByteCode(codePtr);
- }
- while (BP->expanded) {
- BP = BP->expanded;
- }
- TclStackFree(interp, BP); /* free my stack */
-
- return result;
-}
-
-static int
TEBCresume(
ClientData data[],
Tcl_Interp *interp,
@@ -2074,7 +2049,6 @@ TEBCresume(
result = TCL_ERROR;
}
NRE_ASSERT(iPtr->cmdFramePtr == bcFramePtr);
- NRE_ASSERT(TOP_CB(interp)->procPtr == TEBCreturn);
iPtr->cmdFramePtr = bcFramePtr->nextPtr;
TclArgumentBCRelease((Tcl_Interp *) iPtr, bcFramePtr);
@@ -6352,11 +6326,18 @@ TEBCresume(
CLANG_ASSERT(bcFramePtr);
}
+
/*
- * Store the previous bottomPtr for returning to it, then free all
- * resources used by this bytecode and process callbacks until you return
- * to the previous bytecode (if any).
+ * Free all resources associated with this execution
*/
+
+ if (--codePtr->refCount <= 0) {
+ TclCleanupByteCode(codePtr);
+ }
+ while (BP->expanded) {
+ BP = BP->expanded;
+ }
+ TclStackFree(interp, BP); /* free my stack */
iPtr->cmdFramePtr = bcFramePtr->nextPtr;
return result;