X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FUpdates.hc;h=c10b82232fe2ac977f516489d8b76086379c1c0b;hb=b3c8ae4e104c93354738d3992fcf0e60e9646490;hp=aad6dc162967fae307319eac0b013325070a76ea;hpb=8e346b863084d46a87251cae1d8a71de7bf1fd0f;p=ghc-hetmet.git diff --git a/ghc/rts/Updates.hc b/ghc/rts/Updates.hc index aad6dc1..c10b822 100644 --- a/ghc/rts/Updates.hc +++ b/ghc/rts/Updates.hc @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Updates.hc,v 1.19 1999/09/14 12:16:36 simonmar Exp $ + * $Id: Updates.hc,v 1.23 1999/11/29 12:02:46 keithw Exp $ * * (c) The GHC Team, 1998-1999 * @@ -46,6 +46,33 @@ update code. */ +#if defined(REG_Su) +#define UPD_FRAME_ENTRY_TEMPLATE(label,ret) \ + STGFUN(label); \ + STGFUN(label) \ + { \ + FB_ \ + \ + Su = (StgUpdateFrame *)((StgUpdateFrame *)Sp)->updatee; \ + \ + /* Tick - it must be a con, all the paps are handled \ + * in stg_upd_PAP and PAP_entry below \ + */ \ + TICK_UPD_CON_IN_NEW(sizeW_fromITBL(get_itbl(Su))); \ + \ + UPD_IND(Su,R1.p); \ + \ + /* reset Su to the next update frame */ \ + Su = ((StgUpdateFrame *)Sp)->link; \ + \ + /* remove the update frame from the stack */ \ + Sp += sizeofW(StgUpdateFrame); \ + \ + JMP_(ret); \ + FE_ \ + } +#else + #define UPD_FRAME_ENTRY_TEMPLATE(label,ret) \ STGFUN(label); \ STGFUN(label) \ @@ -60,8 +87,7 @@ */ \ TICK_UPD_CON_IN_NEW(sizeW_fromITBL(get_itbl(updatee))); \ \ - /* update the updatee with an indirection to the return value */\ - UPD_IND(updatee,R1.p); \ + UPD_IND(updatee, R1.cl); \ \ /* reset Su to the next update frame */ \ Su = ((StgUpdateFrame *)Sp)->link; \ @@ -72,6 +98,7 @@ JMP_(ret); \ FE_ \ } +#endif UPD_FRAME_ENTRY_TEMPLATE(Upd_frame_entry,ENTRY_CODE(Sp[0])); UPD_FRAME_ENTRY_TEMPLATE(Upd_frame_0_entry,RET_VEC(Sp[0],0)); @@ -598,6 +625,19 @@ FN_(raisezh_fast) FB_ /* args : R1 = error */ +#if defined(PROFILING) + + /* Debugging tool: on raising an exception, show where we are. */ + + /* ToDo: currently this is a hack. Would be much better if + * the info was only displayed for an *uncaught* exception. + */ + if (RtsFlags.ProfFlags.showCCSOnException) { + STGCALL2(print_ccs,stderr,CCCS); + } + +#endif + p = Su; /* This closure represents the expression 'raise# E' where E