Commit 2b8f3628 authored by sewardj's avatar sewardj

[project @ 2001-08-07 09:02:02 by sewardj]

Do suspendThread/resumeThread round ccalls so that ccall_gc is supported.
parent 2f3ae06e
......@@ -5,8 +5,8 @@
* Copyright (c) 1994-2000.
*
* $RCSfile: Interpreter.c,v $
* $Revision: 1.26 $
* $Date: 2001/08/03 15:05:52 $
* $Revision: 1.27 $
* $Date: 2001/08/07 09:02:02 $
* ---------------------------------------------------------------------------*/
#include "Rts.h"
......@@ -55,10 +55,15 @@
#define BCO_ITBL(n) itbls[n]
#define LOAD_STACK_POINTERS \
iSp = cap->rCurrentTSO->sp; iSu = cap->rCurrentTSO->su;
iSp = cap->rCurrentTSO->sp; \
iSu = cap->rCurrentTSO->su; \
/* We don't change this ... */ \
iSpLim = cap->rCurrentTSO->stack + RESERVED_STACK_WORDS;
#define SAVE_STACK_POINTERS \
cap->rCurrentTSO->sp = iSp; cap->rCurrentTSO->su = iSu;
cap->rCurrentTSO->sp = iSp; \
cap->rCurrentTSO->su = iSu;
#define RETURN(retcode) \
SAVE_STACK_POINTERS; return retcode;
......@@ -169,9 +174,6 @@ StgThreadReturnCode interpretBCO ( Capability* cap )
LOAD_STACK_POINTERS;
/* We don't change this ... */
iSpLim = cap->rCurrentTSO->stack + RESERVED_STACK_WORDS;
/* Main object-entering loop. Object to be entered is on top of
stack. */
nextEnter:
......@@ -762,9 +764,14 @@ StgThreadReturnCode interpretBCO ( Capability* cap )
}
}
case bci_CCALL: {
StgInt tok;
int o_itbl = BCO_NEXT;
void(*marshall_fn)(void*) = (void (*)(void*))BCO_LIT(o_itbl);
SAVE_STACK_POINTERS;
tok = suspendThread(cap);
marshall_fn ( (void*)(& StackWord(0) ) );
cap = resumeThread(tok);
LOAD_STACK_POINTERS;
goto nextInsn;
}
case bci_JMP: {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment