X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=rts%2FException.cmm;h=24da1c690e50784451e5f144edce893029cb6f2c;hp=7d1bf3979a0ed7a9b9dd324d7b303db552016684;hb=e5c3b478b3cd1707cf122833822f44b2ac09b8e9;hpb=ad3b79d22b32760f25bf10069bd2957462be959d diff --git a/rts/Exception.cmm b/rts/Exception.cmm index 7d1bf39..24da1c6 100644 --- a/rts/Exception.cmm +++ b/rts/Exception.cmm @@ -13,7 +13,7 @@ #include "Cmm.h" #include "RaiseAsync.h" -import ghczmprim_GHCziBool_True_closure; +import ghczmprim_GHCziTypes_True_closure; /* ----------------------------------------------------------------------------- Exception Primitives @@ -283,11 +283,6 @@ stg_killThreadzh * If the exception went to a catch frame, we'll just continue from * the handler. */ - loop: - if (StgTSO_what_next(target) == ThreadRelocated::I16) { - target = StgTSO__link(target); - goto loop; - } if (target == CurrentTSO) { /* * So what should happen if a thread calls "throwTo self" inside @@ -436,9 +431,9 @@ stg_raisezh #endif retry_pop_stack: - StgTSO_sp(CurrentTSO) = Sp; + SAVE_THREAD_STATE(); (frame_type) = foreign "C" raiseExceptionHelper(BaseReg "ptr", CurrentTSO "ptr", exception "ptr") []; - Sp = StgTSO_sp(CurrentTSO); + LOAD_THREAD_STATE(); if (frame_type == ATOMICALLY_FRAME) { /* The exception has reached the edge of a memory transaction. Check that * the transaction is valid. If not then perhaps the exception should @@ -494,13 +489,12 @@ retry_pop_stack: // be per-thread. CInt[rts_stop_on_exception] = 0; ("ptr" ioAction) = foreign "C" deRefStablePtr (W_[rts_breakpoint_io_action] "ptr") []; - Sp = Sp - WDS(7); - Sp(6) = exception; - Sp(5) = stg_raise_ret_info; - Sp(4) = stg_noforceIO_info; // required for unregisterised + Sp = Sp - WDS(6); + Sp(5) = exception; + Sp(4) = stg_raise_ret_info; Sp(3) = exception; // the AP_STACK - Sp(2) = ghczmprim_GHCziBool_True_closure; // dummy breakpoint info - Sp(1) = ghczmprim_GHCziBool_True_closure; // True <=> a breakpoint + Sp(2) = ghczmprim_GHCziTypes_True_closure; // dummy breakpoint info + Sp(1) = ghczmprim_GHCziTypes_True_closure; // True <=> a breakpoint R1 = ioAction; jump RET_LBL(stg_ap_pppv); } @@ -512,8 +506,10 @@ retry_pop_stack: * We will leave the stack in a GC'able state, see the stg_stop_thread * entry code in StgStartup.cmm. */ - Sp = CurrentTSO + TSO_OFFSET_StgTSO_stack - + WDS(TO_W_(StgTSO_stack_size(CurrentTSO))) - WDS(2); + W_ stack; + stack = StgTSO_stackobj(CurrentTSO); + Sp = stack + OFFSET_StgStack_stack + + WDS(TO_W_(StgStack_stack_size(stack))) - WDS(2); Sp(1) = exception; /* save the exception */ Sp(0) = stg_enter_info; /* so that GC can traverse this stack */ StgTSO_what_next(CurrentTSO) = ThreadKilled::I16;