diff options
author | Simon Marlow <marlowsd@gmail.com> | 2012-10-09 09:23:50 +0100 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2012-10-09 11:13:58 +0100 |
commit | cc2a4d57692ccd40bd552cccbcec15b7d5c97746 (patch) | |
tree | dc93a00b87657b1ba0367392f1497708145a7625 /rts | |
parent | 70765e86772010d09f42ba844fe9f73b17a711c7 (diff) | |
download | haskell-cc2a4d57692ccd40bd552cccbcec15b7d5c97746.tar.gz |
profiling fixes
Diffstat (limited to 'rts')
-rw-r--r-- | rts/HeapStackCheck.cmm | 2 | ||||
-rw-r--r-- | rts/StgStdThunks.cmm | 49 | ||||
-rw-r--r-- | rts/Updates.cmm | 8 | ||||
-rw-r--r-- | rts/Updates.h | 4 |
4 files changed, 32 insertions, 31 deletions
diff --git a/rts/HeapStackCheck.cmm b/rts/HeapStackCheck.cmm index 08adf45b02..1375216646 100644 --- a/rts/HeapStackCheck.cmm +++ b/rts/HeapStackCheck.cmm @@ -216,7 +216,7 @@ stg_gc_prim_n (W_ arg) /* The stg_enter_checkbh frame has the same shape as an update frame: */ INFO_TABLE_RET ( stg_enter_checkbh, RET_SMALL, - UPDATE_FRAME_FIELDS(W_,P_,info_ptr,updatee)) + UPDATE_FRAME_FIELDS(W_,P_,info_ptr,ccs,updatee)) return (P_ ret) { foreign "C" checkBlockingQueues(MyCapability() "ptr", diff --git a/rts/StgStdThunks.cmm b/rts/StgStdThunks.cmm index 0b69a9a279..bd2b3df178 100644 --- a/rts/StgStdThunks.cmm +++ b/rts/StgStdThunks.cmm @@ -28,14 +28,11 @@ -------------------------------------------------------------------------- */ #ifdef PROFILING -#define RET_FIELDS(w_,info_ptr,ccs) \ - w_ info_ptr, \ - w_ ccs -#define GET_SAVED_CCCS CCCS = ccs +#define SAVE_CCS W_ saved_ccs; saved_ccs = CCCS; +#define RESTORE_CCS CCCS = saved_ccs; #else -#define RET_FIELDS(w_,info_ptr,ccs) \ - w_ info_ptr -#define GET_SAVED_CCCS /* empty */ +#define SAVE_CCS /* nothing */ +#define RESTORE_CCS /* nothing */ #endif /* @@ -69,11 +66,13 @@ STK_CHK_NP(node); \ UPD_BH_UPDATABLE(node); \ LDV_ENTER(node); \ - ENTER_CCS_THUNK(node); \ selectee = StgThunk_payload(node,0); \ - push (UPDATE_FRAME_FIELDS(,,stg_upd_frame_info,node)) { \ + push (UPDATE_FRAME_FIELDS(,,stg_upd_frame_info,CCCS,node)) { \ + ENTER_CCS_THUNK(node); \ if (NEED_EVAL(selectee)) { \ + SAVE_CCS; \ (P_ constr) = call %GET_ENTRY(selectee) (selectee); \ + RESTORE_CCS; \ selectee = constr; \ } \ field = StgClosure_payload(UNTAG(selectee),offset); \ @@ -111,10 +110,12 @@ SELECTOR_CODE_UPD(15) STK_CHK_NP(node); \ UPD_BH_UPDATABLE(node); \ LDV_ENTER(node); \ - ENTER_CCS_THUNK(node); \ selectee = StgThunk_payload(node,0); \ if (NEED_EVAL(selectee)) { \ + ENTER_CCS_THUNK(node); \ + SAVE_CCS; \ (P_ constr) = call %GET_ENTRY(selectee) (selectee); \ + RESTORE_CCS; \ selectee = constr; \ } \ field = StgClosure_payload(UNTAG(selectee),offset); \ @@ -164,8 +165,8 @@ INFO_TABLE(stg_ap_1_upd,1,0,THUNK_1_0,"stg_ap_1_upd_info","stg_ap_1_upd_info") STK_CHK_NP(node); UPD_BH_UPDATABLE(node); LDV_ENTER(node); - ENTER_CCS_THUNK(node); - push (UPDATE_FRAME_FIELDS(,,stg_upd_frame_info, node)) { + push (UPDATE_FRAME_FIELDS(,,stg_upd_frame_info, CCCS, node)) { + ENTER_CCS_THUNK(node); jump stg_ap_0_fast (StgThunk_payload(node,0)); } @@ -178,8 +179,8 @@ INFO_TABLE(stg_ap_2_upd,2,0,THUNK_2_0,"stg_ap_2_upd_info","stg_ap_2_upd_info") STK_CHK_NP(node); UPD_BH_UPDATABLE(node); LDV_ENTER(node); - ENTER_CCS_THUNK(node); - push (UPDATE_FRAME_FIELDS(,,stg_upd_frame_info, node)) { + push (UPDATE_FRAME_FIELDS(,,stg_upd_frame_info, CCCS, node)) { + ENTER_CCS_THUNK(node); jump stg_ap_p_fast (StgThunk_payload(node,0), StgThunk_payload(node,1)); @@ -193,8 +194,8 @@ INFO_TABLE(stg_ap_3_upd,3,0,THUNK,"stg_ap_3_upd_info","stg_ap_3_upd_info") STK_CHK_NP(node); UPD_BH_UPDATABLE(node); LDV_ENTER(node); - ENTER_CCS_THUNK(node); - push (UPDATE_FRAME_FIELDS(,,stg_upd_frame_info, node)) { + push (UPDATE_FRAME_FIELDS(,,stg_upd_frame_info, CCCS, node)) { + ENTER_CCS_THUNK(node); jump stg_ap_pp_fast (StgThunk_payload(node,0), StgThunk_payload(node,1), @@ -209,8 +210,8 @@ INFO_TABLE(stg_ap_4_upd,4,0,THUNK,"stg_ap_4_upd_info","stg_ap_4_upd_info") STK_CHK_NP(node); UPD_BH_UPDATABLE(node); LDV_ENTER(node); - ENTER_CCS_THUNK(node); - push (UPDATE_FRAME_FIELDS(,,stg_upd_frame_info, node)) { + push (UPDATE_FRAME_FIELDS(,,stg_upd_frame_info, CCCS, node)) { + ENTER_CCS_THUNK(node); jump stg_ap_ppp_fast (StgThunk_payload(node,0), StgThunk_payload(node,1), @@ -226,8 +227,8 @@ INFO_TABLE(stg_ap_5_upd,5,0,THUNK,"stg_ap_5_upd_info","stg_ap_5_upd_info") STK_CHK_NP(node); UPD_BH_UPDATABLE(node); LDV_ENTER(node); - ENTER_CCS_THUNK(node); - push (UPDATE_FRAME_FIELDS(,,stg_upd_frame_info, node)) { + push (UPDATE_FRAME_FIELDS(,,stg_upd_frame_info, CCCS, node)) { + ENTER_CCS_THUNK(node); jump stg_ap_pppp_fast (StgThunk_payload(node,0), StgThunk_payload(node,1), @@ -244,8 +245,8 @@ INFO_TABLE(stg_ap_6_upd,6,0,THUNK,"stg_ap_6_upd_info","stg_ap_6_upd_info") STK_CHK_NP(node); UPD_BH_UPDATABLE(node); LDV_ENTER(node); - ENTER_CCS_THUNK(node); - push (UPDATE_FRAME_FIELDS(,,stg_upd_frame_info, node)) { + push (UPDATE_FRAME_FIELDS(,,stg_upd_frame_info, CCCS, node)) { + ENTER_CCS_THUNK(node); jump stg_ap_ppppp_fast (StgThunk_payload(node,0), StgThunk_payload(node,1), @@ -263,8 +264,8 @@ INFO_TABLE(stg_ap_7_upd,7,0,THUNK,"stg_ap_7_upd_info","stg_ap_7_upd_info") STK_CHK_NP(node); UPD_BH_UPDATABLE(node); LDV_ENTER(node); - ENTER_CCS_THUNK(node); - push (UPDATE_FRAME_FIELDS(,,stg_upd_frame_info, node)) { + push (UPDATE_FRAME_FIELDS(,,stg_upd_frame_info, CCCS, node)) { + ENTER_CCS_THUNK(node); jump stg_ap_pppppp_fast (StgThunk_payload(node,0), StgThunk_payload(node,1), diff --git a/rts/Updates.cmm b/rts/Updates.cmm index 2bc21ec332..bd6060f142 100644 --- a/rts/Updates.cmm +++ b/rts/Updates.cmm @@ -26,7 +26,7 @@ * we don't mind duplicating this jump. */ INFO_TABLE_RET ( stg_upd_frame, UPDATE_FRAME, - UPDATE_FRAME_FIELDS(W_,P_,info_ptr,updatee) ) + UPDATE_FRAME_FIELDS(W_,P_,info_ptr,_ccs,updatee) ) return (P_ ret) /* the closure being returned */ { /* ToDo: it might be a PAP, so we should check... */ @@ -42,7 +42,7 @@ INFO_TABLE_RET ( stg_upd_frame, UPDATE_FRAME, * another thread in the meantime. */ INFO_TABLE_RET ( stg_marked_upd_frame, UPDATE_FRAME, - UPDATE_FRAME_FIELDS(W_,P_,info_ptr,updatee) ) + UPDATE_FRAME_FIELDS(W_,P_,info_ptr,_ccs,updatee) ) return (P_ ret) /* the closure being returned */ { W_ v, i, tso, link; @@ -77,11 +77,11 @@ INFO_TABLE_RET ( stg_marked_upd_frame, UPDATE_FRAME, * high watermark. */ INFO_TABLE_RET ( stg_bh_upd_frame, UPDATE_FRAME, - UPDATE_FRAME_FIELDS(W_,P_,info_ptr,updatee) ) + UPDATE_FRAME_FIELDS(W_,P_,info_ptr,ccs,updatee) ) return (P_ ret) /* the closure being returned */ { // This all compiles away to a single jump instruction (sigh) jump RET_LBL(stg_marked_upd_frame) - ( UPDATE_FRAME_FIELDS(,,info_ptr,updatee) ) + ( UPDATE_FRAME_FIELDS(,,info_ptr,ccs,updatee) ) (ret); } diff --git a/rts/Updates.h b/rts/Updates.h index 0205e6e763..c65af9ace6 100644 --- a/rts/Updates.h +++ b/rts/Updates.h @@ -35,9 +35,9 @@ */ #ifdef CMINUSMINUS -#define UPDATE_FRAME_FIELDS(w_,p_,info_ptr,updatee) \ +#define UPDATE_FRAME_FIELDS(w_,p_,info_ptr,ccs,updatee) \ w_ info_ptr, \ - PROF_HDR_FIELDS(w_) \ + PROF_HDR_FIELDS_(w_,ccs,_unused_) \ p_ updatee |