X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FInterpreter.c;h=deb42fb97b1c4f51aa64d55a214e30f71765b3bf;hb=7849c8aa807427f9ca8b0897b5d13cf399fd9d23;hp=c249c767b160279af931630bf3d645f73d90b3a4;hpb=593c27ba9d4a5d7d7880ff7b17723da47d6d22b4;p=ghc-hetmet.git diff --git a/ghc/rts/Interpreter.c b/ghc/rts/Interpreter.c index c249c76..deb42fb 100644 --- a/ghc/rts/Interpreter.c +++ b/ghc/rts/Interpreter.c @@ -5,10 +5,11 @@ * Copyright (c) 1994-2000. * * $RCSfile: Interpreter.c,v $ - * $Revision: 1.26 $ - * $Date: 2001/08/03 15:05:52 $ + * $Revision: 1.30 $ + * $Date: 2001/08/14 13:40:09 $ * ---------------------------------------------------------------------------*/ +#include "PosixSource.h" #include "Rts.h" #include "RtsAPI.h" #include "RtsUtils.h" @@ -54,13 +55,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; @@ -169,9 +175,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,10 +764,21 @@ 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: {