diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2009-12-11 05:49:41 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2009-12-11 05:49:41 (GMT) |
commit | 0ee39daeb4a09e4e5d7b72aed5577ac126244244 (patch) | |
tree | a72e6a627aa68519f44d8571e08aa4baa2d90fbd /generic | |
parent | 61ace5272a2905633f2c69fc76b503e6739e6ad2 (diff) | |
download | tcl-0ee39daeb4a09e4e5d7b72aed5577ac126244244.zip tcl-0ee39daeb4a09e4e5d7b72aed5577ac126244244.tar.gz tcl-0ee39daeb4a09e4e5d7b72aed5577ac126244244.tar.bz2 |
code comments
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclExecute.c | 34 |
1 files changed, 14 insertions, 20 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c index a7952d9..ec102b8 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.465 2009/12/11 05:38:11 msofer Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.466 2009/12/11 05:49:41 msofer Exp $ */ #include "tclInt.h" @@ -2835,12 +2835,6 @@ TclExecuteByteCode( NR_DATA_BURY(); switch (type) { case TCL_NR_BC_TYPE: - /* - * A request to run a bytecode: record this level's - * state variables, swap codePtr and start running the - * new one. - */ - if (param) { codePtr = param; goto nonRecursiveCallStart; @@ -2849,10 +2843,10 @@ TclExecuteByteCode( goto resumeCoroutine; } break; - case TCL_NR_TAILCALL_TYPE: - /* - * A request to perform a tailcall: just drop this - * bytecode. */ + case TCL_NR_TAILCALL_TYPE: + /* + * A request to perform a tailcall: just drop this + * bytecode. */ #ifdef TCL_COMPILE_DEBUG if (traceInstructions) { fprintf(stdout, " Tailcall request received\n"); @@ -2860,8 +2854,8 @@ TclExecuteByteCode( #endif /* TCL_COMPILE_DEBUG */ if (catchTop != initCatchTop) { TEOV_callback *tailcallPtr = - iPtr->varFramePtr->tailcallPtr; - + iPtr->varFramePtr->tailcallPtr; + TclClearTailcall(interp, tailcallPtr); iPtr->varFramePtr->tailcallPtr = NULL; TRESULT = TCL_ERROR; @@ -7975,6 +7969,12 @@ TclExecuteByteCode( 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). + */ + OBP = BP->prevBottomPtr; iPtr->cmdFramePtr = bcFramePtr->nextPtr; TclStackFree(interp, BP); /* free my stack */ @@ -7985,13 +7985,7 @@ TclExecuteByteCode( returnToCaller: if (OBP) { - /* - * Restore the state to what it was previous to this bytecode, deal - * with tailcalls. - */ - - BP = OBP; /* back to old bc */ - + BP = OBP; /* back to old bc */ rerunCallbacks: TRESULT = TclNRRunCallbacks(interp, TRESULT, BP->rootPtr, 1); |