diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2009-12-10 17:48:39 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2009-12-10 17:48:39 (GMT) |
commit | 5e126fd43fcba3e54f62f4e92afb95fcf492e683 (patch) | |
tree | e878be33a8af33b564d5e3904935d13e4d28098c /generic/tclBasic.c | |
parent | 5d16655f0b3f57cc706cdc882ed7d0d5edd9c14b (diff) | |
download | tcl-5e126fd43fcba3e54f62f4e92afb95fcf492e683.zip tcl-5e126fd43fcba3e54f62f4e92afb95fcf492e683.tar.gz tcl-5e126fd43fcba3e54f62f4e92afb95fcf492e683.tar.bz2 |
* generic/tclBasic.c: Reducing the # of moving parts for
* generic/tclExecute.c: coroutines by delegating more to tebc;
eliminate the special coroutine CallFrame.
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r-- | generic/tclBasic.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c index 550aaf9..aa1e26b 100644 --- a/generic/tclBasic.c +++ b/generic/tclBasic.c @@ -16,7 +16,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclBasic.c,v 1.425 2009/12/10 16:54:01 msofer Exp $ + * RCS: @(#) $Id: tclBasic.c,v 1.426 2009/12/10 17:48:39 msofer Exp $ */ #include "tclInt.h" @@ -8630,7 +8630,6 @@ NRCoroutineExitCallback( int result) { CoroutineData *corPtr = data[0]; - Tcl_Obj *arglistPtr = data[1]; Command *cmdPtr = corPtr->cmdPtr; /* @@ -8645,10 +8644,6 @@ NRCoroutineExitCallback( NRE_ASSERT(!COR_IS_SUSPENDED(corPtr)); NRE_ASSERT((corPtr->callerEEPtr->callbackPtr->procPtr == NRCoroutineCallerCallback)); - NRE_ASSERT(iPtr->framePtr->compiledLocals == NULL); - TclPopStackFrame(interp); - Tcl_DecrRefCount(arglistPtr); - cmdPtr->deleteProc = NULL; Tcl_DeleteCommandFromToken(interp, (Tcl_Command) cmdPtr); TclCleanupCommandMacro(cmdPtr); @@ -8742,13 +8737,11 @@ TclNRCoroutineObjCmd( Command *cmdPtr; CoroutineData *corPtr; Tcl_Obj *cmdObjPtr; - CallFrame *framePtr, **framePtrPtr; TEOV_callback *rootPtr = TOP_CB(interp); const char *fullName; const char *procName; Namespace *nsPtr, *altNsPtr, *cxtNsPtr; Tcl_DString ds; - Tcl_Obj *arglistPtr; if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "name cmd ?arg ...?"); @@ -8826,19 +8819,6 @@ TclNRCoroutineObjCmd( iPtr->execEnvPtr = corPtr->eePtr; - framePtrPtr = &framePtr; - if (TCL_OK != TclPushStackFrame(interp, (Tcl_CallFrame **) framePtrPtr, - NULL, 0)) { - corPtr->eePtr->corPtr = NULL; - TclDeleteExecEnv(corPtr->eePtr); - ckfree((char *) corPtr); - return TCL_ERROR; - } - arglistPtr = Tcl_NewListObj(objc-2, &objv[2]); - Tcl_IncrRefCount(arglistPtr); - Tcl_ListObjGetElements(interp, arglistPtr, &framePtr->objc, - &framePtr->objv); - /* * Save the base context. The base cmdFramePtr is unknown at this time: it * will be allocated in the Tcl stack. So signal TEBC that it has to @@ -8899,12 +8879,11 @@ TclNRCoroutineObjCmd( * the cleaner "proc is a named lambda" to do this properly. */ - iPtr->varFramePtr = iPtr->rootFramePtr; iPtr->lookupNsPtr = iPtr->framePtr->nsPtr; corPtr->auxNumLevels = iPtr->numLevels; - TclNRAddCallback(interp, NRCoroutineExitCallback, corPtr, arglistPtr, - NULL,NULL); + TclNRAddCallback(interp, NRCoroutineExitCallback, corPtr, + NULL, NULL, NULL); iPtr->evalFlags |= TCL_EVAL_REDIRECT; TclNREvalObjEx(interp, cmdObjPtr, 0, NULL, 0); |