X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FStgStdThunks.cmm;h=be859995981d18236975aa8301f790a3d6b2a525;hb=d8334d807812e40f67770ffc37608c0ce66f96b2;hp=20ceb6aaba1bc115a63a096a30829b05023d00ef;hpb=6015a94f9108a502150565577b66c23650796639;p=ghc-hetmet.git diff --git a/rts/StgStdThunks.cmm b/rts/StgStdThunks.cmm index 20ceb6a..be85999 100644 --- a/rts/StgStdThunks.cmm +++ b/rts/StgStdThunks.cmm @@ -52,7 +52,22 @@ * so we untag it before accessing the field. * */ -#define SELECTOR_CODE_UPD(offset) \ +#ifdef PROFILING +// When profiling, we cannot shortcut by checking the tag, +// because LDV profiling relies on entering closures to mark them as +// "used". +#define SEL_ENTER(offset) \ + R1 = UNTAG(R1); \ + jump %GET_ENTRY(R1); +#else +#define SEL_ENTER(offset) \ + if (GETTAG(R1) != 0) { \ + jump RET_LBL(stg_sel_ret_##offset##_upd); \ + } \ + jump %GET_ENTRY(R1); +#endif + +#define SELECTOR_CODE_UPD(offset) \ INFO_TABLE_RET(stg_sel_ret_##offset##_upd, RET_SMALL, RET_PARAMS) \ { \ R1 = StgClosure_payload(UNTAG(R1),offset); \ @@ -73,10 +88,7 @@ W_[Sp-WITHUPD_FRAME_SIZE] = stg_sel_ret_##offset##_upd_info; \ Sp = Sp - WITHUPD_FRAME_SIZE; \ R1 = StgThunk_payload(R1,0); \ - if (GETTAG(R1) != 0) { \ - jump RET_LBL(stg_sel_ret_##offset##_upd); \ - } \ - jump %GET_ENTRY(R1); \ + SEL_ENTER(offset); \ } /* NOTE: no need to ENTER() here, we know the closure cannot evaluate to a function, because we're going to do a field selection on the result. */ @@ -160,7 +172,7 @@ SELECTOR_CODE_NOUPD(15) * in the compiler that means stg_ap_1 is generated occasionally (ToDo) */ -INFO_TABLE(stg_ap_1_upd,1,1,THUNK_1_0,"stg_ap_1_upd_info","stg_ap_1_upd_info") +INFO_TABLE(stg_ap_1_upd,1,0,THUNK_1_0,"stg_ap_1_upd_info","stg_ap_1_upd_info") { TICK_ENT_DYN_THK(); STK_CHK_NP(SIZEOF_StgUpdateFrame+WDS(1));