summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2009-12-10 17:48:39 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2009-12-10 17:48:39 (GMT)
commit5e126fd43fcba3e54f62f4e92afb95fcf492e683 (patch)
treee878be33a8af33b564d5e3904935d13e4d28098c /generic
parent5d16655f0b3f57cc706cdc882ed7d0d5edd9c14b (diff)
downloadtcl-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')
-rw-r--r--generic/tclBasic.c27
-rw-r--r--generic/tclExecute.c3
2 files changed, 5 insertions, 25 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);
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 9597075..28fab46 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.459 2009/12/10 16:54:01 msofer Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.460 2009/12/10 17:48:39 msofer Exp $
*/
#include "tclInt.h"
@@ -2040,6 +2040,7 @@ TclExecuteByteCode(
corPtr->base.cmdFramePtr = bcFramePtr;
BP->prevBottomPtr = NULL;
+ iPtr->varFramePtr->callerPtr = iPtr->rootFramePtr;
}
if (!corPtr->stackLevel) {