X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FInterpreter.c;h=68ab9fe7fcb2aaea0231310a41d9c98eaeb7c37c;hb=1dc12c3c4acba688327fb2429f0a822bd98a5753;hp=657e25fdfb39d929c4c463968f18c9fb52737a17;hpb=8393d46a2dcf3dc687797da45b1d269ae518f90e;p=ghc-hetmet.git diff --git a/ghc/rts/Interpreter.c b/ghc/rts/Interpreter.c index 657e25f..68ab9fe 100644 --- a/ghc/rts/Interpreter.c +++ b/ghc/rts/Interpreter.c @@ -5,8 +5,8 @@ * Copyright (c) 1994-2000. * * $RCSfile: Interpreter.c,v $ - * $Revision: 1.23 $ - * $Date: 2001/05/25 18:32:51 $ + * $Revision: 1.29 $ + * $Date: 2001/08/09 11:23:19 $ * ---------------------------------------------------------------------------*/ #include "Rts.h" @@ -54,13 +54,18 @@ #define BCO_LIT(n) (W_)literals[n] #define BCO_ITBL(n) itbls[n] -#define LOAD_STACK_POINTERS \ - iSp = cap->rCurrentTSO->sp; iSu = cap->rCurrentTSO->su; +#define LOAD_STACK_POINTERS \ + 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; +#define SAVE_STACK_POINTERS \ + cap->rCurrentTSO->sp = iSp; \ + cap->rCurrentTSO->su = iSu; -#define RETURN(retcode) \ +#define RETURN(retcode) \ SAVE_STACK_POINTERS; return retcode; @@ -115,7 +120,7 @@ void interp_startup ( void ) void interp_shutdown ( void ) { int i, j, k, o_max, i_max, j_max; - fprintf(stderr, "%d constrs entered -> (%d BCO, %d UPD, %d ??)\n", + fprintf(stderr, "%d constrs entered -> (%d BCO, %d UPD, %d ??? )\n", it_retto_BCO + it_retto_UPDATE + it_retto_other, it_retto_BCO, it_retto_UPDATE, it_retto_other ); fprintf(stderr, "%d total entries, %d unknown entries \n", @@ -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: @@ -761,7 +763,23 @@ StgThreadReturnCode interpretBCO ( Capability* cap ) } } } - + case bci_SWIZZLE: { + int stkoff = BCO_NEXT; + signed short n = (signed short)(BCO_NEXT); + StackWord(stkoff) += (W_)n; + goto nextInsn; + } + 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: { /* BCO_NEXT modifies bciPtr, so be conservative. */ int nextpc = BCO_NEXT;