summaryrefslogtreecommitdiffstats
path: root/generic/tclBasic.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2009-12-08 21:44:56 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2009-12-08 21:44:56 (GMT)
commit8c26b3a75b9dd2609485169cd288ca77926bd8d6 (patch)
tree3d7346f879726d81a8fbb39c3e578ee435737adc /generic/tclBasic.c
parentb475ec90cf97e4e17e2fda2954e1983c882ab339 (diff)
downloadtcl-8c26b3a75b9dd2609485169cd288ca77926bd8d6.zip
tcl-8c26b3a75b9dd2609485169cd288ca77926bd8d6.tar.gz
tcl-8c26b3a75b9dd2609485169cd288ca77926bd8d6.tar.bz2
baby steps towards nre-enabling coroutine first run
Diffstat (limited to 'generic/tclBasic.c')
-rw-r--r--generic/tclBasic.c36
1 files changed, 8 insertions, 28 deletions
diff --git a/generic/tclBasic.c b/generic/tclBasic.c
index 3d777d3..072dfe3 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.418 2009/12/08 20:56:29 msofer Exp $
+ * RCS: @(#) $Id: tclBasic.c,v 1.419 2009/12/08 21:44:56 msofer Exp $
*/
#include "tclInt.h"
@@ -8394,8 +8394,6 @@ static int RewindCoroutine(CoroutineData *corPtr, int result);
static void DeleteCoroutine(ClientData clientData);
static void PlugCoroutineChains(CoroutineData *corPtr);
-static int NRCoroutineFirstCallback(ClientData data[],
- Tcl_Interp *interp, int result);
static int NRCoroutineExitCallback(ClientData data[],
Tcl_Interp *interp, int result);
static int NRCoroutineCallerCallback(ClientData data[],
@@ -8590,26 +8588,6 @@ PlugCoroutineChains(
}
static int
-NRCoroutineFirstCallback(
- ClientData data[],
- Tcl_Interp *interp,
- int result)
-{
- CoroutineData *corPtr = data[0];
- register CmdFrame *tmpPtr = iPtr->cmdFramePtr;
-
- if (corPtr->eePtr) {
- while (tmpPtr->nextPtr != corPtr->caller.cmdFramePtr) {
- tmpPtr = tmpPtr->nextPtr;
- }
-
- corPtr->base.cmdFramePtr = tmpPtr;
- }
-
- return result;
-}
-
-static int
NRCoroutineCallerCallback(
ClientData data[],
Tcl_Interp *interp,
@@ -8674,9 +8652,7 @@ NRCoroutineExitCallback(
NRE_ASSERT(TOP_CB(interp) == NULL);
NRE_ASSERT(iPtr->execEnvPtr == corPtr->eePtr);
NRE_ASSERT(!COR_IS_SUSPENDED(corPtr));
- NRE_ASSERT((corPtr->callerEEPtr->callbackPtr->procPtr == NRCoroutineCallerCallback)
- || ((corPtr->callerEEPtr->callbackPtr->procPtr == NRCoroutineFirstCallback) &&
- (corPtr->callerEEPtr->callbackPtr->nextPtr->procPtr == NRCoroutineCallerCallback)));
+ NRE_ASSERT((corPtr->callerEEPtr->callbackPtr->procPtr == NRCoroutineCallerCallback));
NRE_ASSERT(iPtr->framePtr->compiledLocals == NULL);
TclPopStackFrame(interp);
@@ -8859,8 +8835,6 @@ TclNRCoroutineObjCmd(
TclNRAddCallback(interp, NRCoroutineCallerCallback, corPtr, NULL, NULL,
NULL);
- TclNRAddCallback(interp, NRCoroutineFirstCallback, corPtr, NULL, NULL,
- NULL);
SAVE_CONTEXT(corPtr->caller);
iPtr->execEnvPtr = corPtr->eePtr;
@@ -8880,6 +8854,12 @@ TclNRCoroutineObjCmd(
corPtr->running = NULL_CONTEXT;
/*
+ * Signal TEBC that it has to initialize the base cmdFramePtr.
+ */
+
+ corPtr->base.cmdFramePtr = NULL;
+
+ /*
* #280.
* Provide the new coroutine with its own copy of the lineLABCPtr
* hashtable for literal command arguments in bytecode. Note that that