diff options
author | Simon Marlow <simonmar@microsoft.com> | 2007-02-28 13:07:14 +0000 |
---|---|---|
committer | Simon Marlow <simonmar@microsoft.com> | 2007-02-28 13:07:14 +0000 |
commit | 9ff76535edb25ab7434284adddb5c64708ecb547 (patch) | |
tree | 3f2fb3ec0b66cd1c85d73a56e92e36b57de1b362 /rts | |
parent | 6a7778b95a726f460288123d0539310bb66302f4 (diff) | |
download | haskell-9ff76535edb25ab7434284adddb5c64708ecb547.tar.gz |
Remove vectored returns.
We recently discovered that they aren't a win any more, and just cost
code size.
Diffstat (limited to 'rts')
-rw-r--r-- | rts/ClosureFlags.c | 4 | ||||
-rw-r--r-- | rts/Exception.cmm | 57 | ||||
-rw-r--r-- | rts/LdvProfile.c | 2 | ||||
-rw-r--r-- | rts/Linker.c | 9 | ||||
-rw-r--r-- | rts/PrimOps.cmm | 137 | ||||
-rw-r--r-- | rts/Printer.c | 6 | ||||
-rw-r--r-- | rts/ProfHeap.c | 2 | ||||
-rw-r--r-- | rts/RetainerProfile.c | 8 | ||||
-rw-r--r-- | rts/Sanity.c | 4 | ||||
-rw-r--r-- | rts/StgMiscClosures.cmm | 54 | ||||
-rw-r--r-- | rts/StgStartup.cmm | 17 | ||||
-rw-r--r-- | rts/Ticky.c | 17 | ||||
-rw-r--r-- | rts/Updates.cmm | 99 | ||||
-rw-r--r-- | rts/sm/Compact.c | 2 | ||||
-rw-r--r-- | rts/sm/Evac.c | 2 | ||||
-rw-r--r-- | rts/sm/Scav.c | 2 |
16 files changed, 61 insertions, 361 deletions
diff --git a/rts/ClosureFlags.c b/rts/ClosureFlags.c index c282cf3a88..5a34c5eabc 100644 --- a/rts/ClosureFlags.c +++ b/rts/ClosureFlags.c @@ -61,9 +61,7 @@ StgWord16 closure_flags[] = { /* IND_STATIC = */ ( _NS|_STA| _IND ), /* RET_BCO = */ ( _BTM ), /* RET_SMALL = */ ( _BTM| _SRT ), -/* RET_VEC_SMALL = */ ( _BTM| _SRT ), /* RET_BIG = */ ( _SRT ), -/* RET_VEC_BIG = */ ( _SRT ), /* RET_DYN = */ ( _SRT ), /* RET_FUN = */ ( 0 ), /* UPDATE_FRAME = */ ( _BTM ), @@ -101,6 +99,6 @@ StgWord16 closure_flags[] = { /* CATCH_STM_FRAME = */ ( _BTM ) }; -#if N_CLOSURE_TYPES != 73 +#if N_CLOSURE_TYPES != 71 #error Closure types changed: update ClosureFlags.c! #endif diff --git a/rts/Exception.cmm b/rts/Exception.cmm index a3f3dd0d82..c86c6d59ff 100644 --- a/rts/Exception.cmm +++ b/rts/Exception.cmm @@ -267,43 +267,11 @@ killThreadzh_fast -------------------------------------------------------------------------- */ #ifdef REG_R1 -#define CATCH_FRAME_ENTRY_TEMPLATE(label,ret) \ - label \ - { \ - Sp = Sp + SIZEOF_StgCatchFrame; \ - jump ret; \ - } -#else -#define CATCH_FRAME_ENTRY_TEMPLATE(label,ret) \ - label \ - { \ - W_ rval; \ - rval = Sp(0); \ - Sp = Sp + SIZEOF_StgCatchFrame; \ - Sp(0) = rval; \ - jump ret; \ - } -#endif - -#ifdef REG_R1 #define SP_OFF 0 #else #define SP_OFF 1 #endif -CATCH_FRAME_ENTRY_TEMPLATE(stg_catch_frame_0_ret,%RET_VEC(Sp(SP_OFF),0)) -CATCH_FRAME_ENTRY_TEMPLATE(stg_catch_frame_1_ret,%RET_VEC(Sp(SP_OFF),1)) -CATCH_FRAME_ENTRY_TEMPLATE(stg_catch_frame_2_ret,%RET_VEC(Sp(SP_OFF),2)) -CATCH_FRAME_ENTRY_TEMPLATE(stg_catch_frame_3_ret,%RET_VEC(Sp(SP_OFF),3)) -CATCH_FRAME_ENTRY_TEMPLATE(stg_catch_frame_4_ret,%RET_VEC(Sp(SP_OFF),4)) -CATCH_FRAME_ENTRY_TEMPLATE(stg_catch_frame_5_ret,%RET_VEC(Sp(SP_OFF),5)) -CATCH_FRAME_ENTRY_TEMPLATE(stg_catch_frame_6_ret,%RET_VEC(Sp(SP_OFF),6)) -CATCH_FRAME_ENTRY_TEMPLATE(stg_catch_frame_7_ret,%RET_VEC(Sp(SP_OFF),7)) - -#if MAX_VECTORED_RTN > 8 -#error MAX_VECTORED_RTN has changed: please modify stg_catch_frame too. -#endif - #if defined(PROFILING) #define CATCH_FRAME_BITMAP 7 #define CATCH_FRAME_WORDS 4 @@ -319,16 +287,21 @@ CATCH_FRAME_ENTRY_TEMPLATE(stg_catch_frame_7_ret,%RET_VEC(Sp(SP_OFF),7)) INFO_TABLE_RET(stg_catch_frame, CATCH_FRAME_WORDS, CATCH_FRAME_BITMAP, - CATCH_FRAME, - stg_catch_frame_0_ret, - stg_catch_frame_1_ret, - stg_catch_frame_2_ret, - stg_catch_frame_3_ret, - stg_catch_frame_4_ret, - stg_catch_frame_5_ret, - stg_catch_frame_6_ret, - stg_catch_frame_7_ret) -CATCH_FRAME_ENTRY_TEMPLATE(,%ENTRY_CODE(Sp(SP_OFF))) + CATCH_FRAME) +#ifdef REG_R1 + { + Sp = Sp + SIZEOF_StgCatchFrame; + jump Sp(SP_OFF); + } +#else + { + W_ rval; + rval = Sp(0); + Sp = Sp + SIZEOF_StgCatchFrame; + Sp(0) = rval; + jump Sp(SP_OFF); + } +#endif /* ----------------------------------------------------------------------------- * The catch infotable diff --git a/rts/LdvProfile.c b/rts/LdvProfile.c index 28aa326ede..193344e4f5 100644 --- a/rts/LdvProfile.c +++ b/rts/LdvProfile.c @@ -177,9 +177,7 @@ processHeapClosureForDead( StgClosure *c ) case RET_DYN: case RET_BCO: case RET_SMALL: - case RET_VEC_SMALL: case RET_BIG: - case RET_VEC_BIG: // others case BLOCKED_FETCH: case FETCH_ME: diff --git a/rts/Linker.c b/rts/Linker.c index dc31869517..42ae1777df 100644 --- a/rts/Linker.c +++ b/rts/Linker.c @@ -457,7 +457,6 @@ typedef struct _RtsSymbolVal { SymX(stg_block_1) \ SymX(stg_block_takemvar) \ SymX(stg_block_putmvar) \ - SymX(stg_seq_frame_info) \ MAIN_CAP_SYM \ SymX(MallocFailHook) \ SymX(OnExitHook) \ @@ -700,14 +699,6 @@ typedef struct _RtsSymbolVal { SymX(xorIntegerzh_fast) \ SymX(yieldzh_fast) \ SymX(stg_interp_constr_entry) \ - SymX(stg_interp_constr1_entry) \ - SymX(stg_interp_constr2_entry) \ - SymX(stg_interp_constr3_entry) \ - SymX(stg_interp_constr4_entry) \ - SymX(stg_interp_constr5_entry) \ - SymX(stg_interp_constr6_entry) \ - SymX(stg_interp_constr7_entry) \ - SymX(stg_interp_constr8_entry) \ SymX(allocateExec) \ SymX(freeExec) \ SymX(getAllocations) \ diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 955e50bbff..545aa480cd 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -970,22 +970,6 @@ isCurrentThreadBoundzh_fast // Catch retry frame ------------------------------------------------------------ -#define CATCH_RETRY_FRAME_ERROR(label) \ - label { foreign "C" barf("catch_retry_frame incorrectly entered!"); } - -CATCH_RETRY_FRAME_ERROR(stg_catch_retry_frame_0_ret) -CATCH_RETRY_FRAME_ERROR(stg_catch_retry_frame_1_ret) -CATCH_RETRY_FRAME_ERROR(stg_catch_retry_frame_2_ret) -CATCH_RETRY_FRAME_ERROR(stg_catch_retry_frame_3_ret) -CATCH_RETRY_FRAME_ERROR(stg_catch_retry_frame_4_ret) -CATCH_RETRY_FRAME_ERROR(stg_catch_retry_frame_5_ret) -CATCH_RETRY_FRAME_ERROR(stg_catch_retry_frame_6_ret) -CATCH_RETRY_FRAME_ERROR(stg_catch_retry_frame_7_ret) - -#if MAX_VECTORED_RTN > 8 -#error MAX_VECTORED_RTN has changed: please modify stg_catch_retry_frame too. -#endif - #if defined(PROFILING) #define CATCH_RETRY_FRAME_BITMAP 7 #define CATCH_RETRY_FRAME_WORDS 5 @@ -996,15 +980,7 @@ CATCH_RETRY_FRAME_ERROR(stg_catch_retry_frame_7_ret) INFO_TABLE_RET(stg_catch_retry_frame, CATCH_RETRY_FRAME_WORDS, CATCH_RETRY_FRAME_BITMAP, - CATCH_RETRY_FRAME, - stg_catch_retry_frame_0_ret, - stg_catch_retry_frame_1_ret, - stg_catch_retry_frame_2_ret, - stg_catch_retry_frame_3_ret, - stg_catch_retry_frame_4_ret, - stg_catch_retry_frame_5_ret, - stg_catch_retry_frame_6_ret, - stg_catch_retry_frame_7_ret) + CATCH_RETRY_FRAME) { W_ r, frame, trec, outer; IF_NOT_REG_R1(W_ rval; rval = Sp(0); Sp_adj(1); ) @@ -1034,24 +1010,7 @@ INFO_TABLE_RET(stg_catch_retry_frame, } -// Atomically frame ------------------------------------------------------------- - - -#define ATOMICALLY_FRAME_ERROR(label) \ - label { foreign "C" barf("atomically_frame incorrectly entered!"); } - -ATOMICALLY_FRAME_ERROR(stg_atomically_frame_0_ret) -ATOMICALLY_FRAME_ERROR(stg_atomically_frame_1_ret) -ATOMICALLY_FRAME_ERROR(stg_atomically_frame_2_ret) -ATOMICALLY_FRAME_ERROR(stg_atomically_frame_3_ret) -ATOMICALLY_FRAME_ERROR(stg_atomically_frame_4_ret) -ATOMICALLY_FRAME_ERROR(stg_atomically_frame_5_ret) -ATOMICALLY_FRAME_ERROR(stg_atomically_frame_6_ret) -ATOMICALLY_FRAME_ERROR(stg_atomically_frame_7_ret) - -#if MAX_VECTORED_RTN > 8 -#error MAX_VECTORED_RTN has changed: please modify stg_atomically_frame too. -#endif +// Atomically frame ------------------------------------------------------------ #if defined(PROFILING) #define ATOMICALLY_FRAME_BITMAP 3 @@ -1061,18 +1020,9 @@ ATOMICALLY_FRAME_ERROR(stg_atomically_frame_7_ret) #define ATOMICALLY_FRAME_WORDS 2 #endif - INFO_TABLE_RET(stg_atomically_frame, ATOMICALLY_FRAME_WORDS, ATOMICALLY_FRAME_BITMAP, - ATOMICALLY_FRAME, - stg_atomically_frame_0_ret, - stg_atomically_frame_1_ret, - stg_atomically_frame_2_ret, - stg_atomically_frame_3_ret, - stg_atomically_frame_4_ret, - stg_atomically_frame_5_ret, - stg_atomically_frame_6_ret, - stg_atomically_frame_7_ret) + ATOMICALLY_FRAME) { W_ frame, trec, valid, next_invariant, q, outer; IF_NOT_REG_R1(W_ rval; rval = Sp(0); Sp_adj(1); ) @@ -1134,15 +1084,7 @@ INFO_TABLE_RET(stg_atomically_frame, INFO_TABLE_RET(stg_atomically_waiting_frame, ATOMICALLY_FRAME_WORDS, ATOMICALLY_FRAME_BITMAP, - ATOMICALLY_FRAME, - stg_atomically_frame_0_ret, - stg_atomically_frame_1_ret, - stg_atomically_frame_2_ret, - stg_atomically_frame_3_ret, - stg_atomically_frame_4_ret, - stg_atomically_frame_5_ret, - stg_atomically_frame_6_ret, - stg_atomically_frame_7_ret) + ATOMICALLY_FRAME) { W_ frame, trec, valid; IF_NOT_REG_R1(W_ rval; rval = Sp(0); Sp_adj(1); ) @@ -1169,50 +1111,12 @@ INFO_TABLE_RET(stg_atomically_waiting_frame, // STM catch frame -------------------------------------------------------------- -#define CATCH_STM_FRAME_ENTRY_TEMPLATE(label,ret) \ - label \ - { \ - IF_NOT_REG_R1(W_ rval; rval = Sp(0); Sp_adj(1); ) \ - W_ r, frame, trec, outer; \ - frame = Sp; \ - trec = StgTSO_trec(CurrentTSO); \ - "ptr" outer = foreign "C" stmGetEnclosingTRec(trec "ptr") []; \ - r = foreign "C" stmCommitNestedTransaction(MyCapability() "ptr", trec "ptr") []; \ - if (r != 0) { \ - /* Commit succeeded */ \ - StgTSO_trec(CurrentTSO) = outer; \ - Sp = Sp + SIZEOF_StgCatchSTMFrame; \ - IF_NOT_REG_R1(Sp_adj(-1); Sp(0) = rval;) \ - jump ret; \ - } else { \ - /* Commit failed */ \ - W_ new_trec; \ - "ptr" new_trec = foreign "C" stmStartTransaction(MyCapability() "ptr", outer "ptr") []; \ - StgTSO_trec(CurrentTSO) = new_trec; \ - R1 = StgCatchSTMFrame_code(frame); \ - jump stg_ap_v_fast; \ - } \ - } - #ifdef REG_R1 #define SP_OFF 0 #else #define SP_OFF 1 #endif -CATCH_STM_FRAME_ENTRY_TEMPLATE(stg_catch_stm_frame_0_ret,%RET_VEC(Sp(SP_OFF),0)) -CATCH_STM_FRAME_ENTRY_TEMPLATE(stg_catch_stm_frame_1_ret,%RET_VEC(Sp(SP_OFF),1)) -CATCH_STM_FRAME_ENTRY_TEMPLATE(stg_catch_stm_frame_2_ret,%RET_VEC(Sp(SP_OFF),2)) -CATCH_STM_FRAME_ENTRY_TEMPLATE(stg_catch_stm_frame_3_ret,%RET_VEC(Sp(SP_OFF),3)) -CATCH_STM_FRAME_ENTRY_TEMPLATE(stg_catch_stm_frame_4_ret,%RET_VEC(Sp(SP_OFF),4)) -CATCH_STM_FRAME_ENTRY_TEMPLATE(stg_catch_stm_frame_5_ret,%RET_VEC(Sp(SP_OFF),5)) -CATCH_STM_FRAME_ENTRY_TEMPLATE(stg_catch_stm_frame_6_ret,%RET_VEC(Sp(SP_OFF),6)) -CATCH_STM_FRAME_ENTRY_TEMPLATE(stg_catch_stm_frame_7_ret,%RET_VEC(Sp(SP_OFF),7)) - -#if MAX_VECTORED_RTN > 8 -#error MAX_VECTORED_RTN has changed: please modify stg_catch_stm_frame too. -#endif - #if defined(PROFILING) #define CATCH_STM_FRAME_BITMAP 3 #define CATCH_STM_FRAME_WORDS 4 @@ -1228,16 +1132,29 @@ CATCH_STM_FRAME_ENTRY_TEMPLATE(stg_catch_stm_frame_7_ret,%RET_VEC(Sp(SP_OFF),7)) INFO_TABLE_RET(stg_catch_stm_frame, CATCH_STM_FRAME_WORDS, CATCH_STM_FRAME_BITMAP, - CATCH_STM_FRAME, - stg_catch_stm_frame_0_ret, - stg_catch_stm_frame_1_ret, - stg_catch_stm_frame_2_ret, - stg_catch_stm_frame_3_ret, - stg_catch_stm_frame_4_ret, - stg_catch_stm_frame_5_ret, - stg_catch_stm_frame_6_ret, - stg_catch_stm_frame_7_ret) -CATCH_STM_FRAME_ENTRY_TEMPLATE(,%ENTRY_CODE(Sp(SP_OFF))) + CATCH_STM_FRAME) + { + IF_NOT_REG_R1(W_ rval; rval = Sp(0); Sp_adj(1); ) + W_ r, frame, trec, outer; + frame = Sp; + trec = StgTSO_trec(CurrentTSO); + "ptr" outer = foreign "C" stmGetEnclosingTRec(trec "ptr") []; + r = foreign "C" stmCommitNestedTransaction(MyCapability() "ptr", trec "ptr") []; + if (r != 0) { + /* Commit succeeded */ + StgTSO_trec(CurrentTSO) = outer; + Sp = Sp + SIZEOF_StgCatchSTMFrame; + IF_NOT_REG_R1(Sp_adj(-1); Sp(0) = rval;) + jump Sp(SP_OFF); + } else { + /* Commit failed */ + W_ new_trec; + "ptr" new_trec = foreign "C" stmStartTransaction(MyCapability() "ptr", outer "ptr") []; + StgTSO_trec(CurrentTSO) = new_trec; + R1 = StgCatchSTMFrame_code(frame); + jump stg_ap_v_fast; + } + } // Primop definition ------------------------------------------------------------ diff --git a/rts/Printer.c b/rts/Printer.c index 666b7db6ce..6da32fc6f8 100644 --- a/rts/Printer.c +++ b/rts/Printer.c @@ -261,9 +261,7 @@ printClosure( StgClosure *obj ) /* Cannot happen -- use default case. case RET_BCO: case RET_SMALL: - case RET_VEC_SMALL: case RET_BIG: - case RET_VEC_BIG: case RET_DYN: case RET_FUN: */ @@ -576,7 +574,6 @@ printStackChunk( StgPtr sp, StgPtr spBottom ) } case RET_SMALL: - case RET_VEC_SMALL: debugBelch("RET_SMALL (%p)\n", info); bitmap = info->layout.bitmap; printSmallBitmap(spBottom, sp+1, @@ -595,7 +592,6 @@ printStackChunk( StgPtr sp, StgPtr spBottom ) } case RET_BIG: - case RET_VEC_BIG: barf("todo"); case RET_FUN: @@ -682,9 +678,7 @@ static char *closure_type_names[] = { "IND_STATIC", "RET_BCO", "RET_SMALL", - "RET_VEC_SMALL", "RET_BIG", - "RET_VEC_BIG", "RET_DYN", "RET_FUN", "UPDATE_FRAME", diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c index e93151d4f4..ea71e20fd4 100644 --- a/rts/ProfHeap.c +++ b/rts/ProfHeap.c @@ -137,9 +137,7 @@ static char *type_names[] = { , "RET_BCO" , "RET_SMALL" - , "RET_VEC_SMALL" , "RET_BIG" - , "RET_VEC_BIG" , "RET_DYN" , "UPDATE_FRAME" , "CATCH_FRAME" diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c index 23d6f9dd09..4920e7d09d 100644 --- a/rts/RetainerProfile.c +++ b/rts/RetainerProfile.c @@ -618,9 +618,7 @@ push( StgClosure *c, retainer c_child_r, StgClosure **first_child ) case RET_DYN: case RET_BCO: case RET_SMALL: - case RET_VEC_SMALL: case RET_BIG: - case RET_VEC_BIG: // invalid objects case IND: case BLOCKED_FETCH: @@ -984,9 +982,7 @@ pop( StgClosure **c, StgClosure **cp, retainer *r ) case STOP_FRAME: case RET_BCO: case RET_SMALL: - case RET_VEC_SMALL: case RET_BIG: - case RET_VEC_BIG: // invalid objects case IND: case BLOCKED_FETCH: @@ -1150,9 +1146,7 @@ isRetainer( StgClosure *c ) case RET_DYN: case RET_BCO: case RET_SMALL: - case RET_VEC_SMALL: case RET_BIG: - case RET_VEC_BIG: // other cases case IND: case BLOCKED_FETCH: @@ -1387,7 +1381,6 @@ retainStack( StgClosure *c, retainer c_child_r, case CATCH_RETRY_FRAME: case ATOMICALLY_FRAME: case RET_SMALL: - case RET_VEC_SMALL: bitmap = BITMAP_BITS(info->i.layout.bitmap); size = BITMAP_SIZE(info->i.layout.bitmap); p++; @@ -1412,7 +1405,6 @@ retainStack( StgClosure *c, retainer c_child_r, // large bitmap (> 32 entries, or > 64 on a 64-bit machine) case RET_BIG: - case RET_VEC_BIG: size = GET_LARGE_BITMAP(&info->i)->size; p++; retain_large_bitmap(p, GET_LARGE_BITMAP(&info->i), diff --git a/rts/Sanity.c b/rts/Sanity.c index 6fdca3624a..7de8ec7d0a 100644 --- a/rts/Sanity.c +++ b/rts/Sanity.c @@ -137,7 +137,6 @@ checkStackFrame( StgPtr c ) // small bitmap cases (<= 32 entries) case STOP_FRAME: case RET_SMALL: - case RET_VEC_SMALL: size = BITMAP_SIZE(info->i.layout.bitmap); checkSmallBitmap((StgPtr)c + 1, BITMAP_BITS(info->i.layout.bitmap), size); @@ -153,7 +152,6 @@ checkStackFrame( StgPtr c ) } case RET_BIG: // large bitmap (> 32 entries) - case RET_VEC_BIG: size = GET_LARGE_BITMAP(&info->i)->size; checkLargeBitmap((StgPtr)c + 1, GET_LARGE_BITMAP(&info->i), size); return 1 + size; @@ -361,9 +359,7 @@ checkClosure( StgClosure* p ) case RET_BCO: case RET_SMALL: - case RET_VEC_SMALL: case RET_BIG: - case RET_VEC_BIG: case RET_DYN: case UPDATE_FRAME: case STOP_FRAME: diff --git a/rts/StgMiscClosures.cmm b/rts/StgMiscClosures.cmm index 93de540d88..e532e51a53 100644 --- a/rts/StgMiscClosures.cmm +++ b/rts/StgMiscClosures.cmm @@ -23,15 +23,6 @@ stg_interp_constr_entry jump %ENTRY_CODE(Sp(0)); } -stg_interp_constr1_entry { jump %RET_VEC(Sp(0),0); } -stg_interp_constr2_entry { jump %RET_VEC(Sp(0),1); } -stg_interp_constr3_entry { jump %RET_VEC(Sp(0),2); } -stg_interp_constr4_entry { jump %RET_VEC(Sp(0),3); } -stg_interp_constr5_entry { jump %RET_VEC(Sp(0),4); } -stg_interp_constr6_entry { jump %RET_VEC(Sp(0),5); } -stg_interp_constr7_entry { jump %RET_VEC(Sp(0),6); } -stg_interp_constr8_entry { jump %RET_VEC(Sp(0),7); } - /* Some info tables to be used when compiled code returns a value to the interpreter, i.e. the interpreter pushes one of these onto the stack before entering a value. What the code does is to @@ -68,15 +59,7 @@ stg_interp_constr8_entry { jump %RET_VEC(Sp(0),7); } INFO_TABLE_RET( stg_ctoi_R1p, 0/*size*/, 0/*bitmap*/, /* special layout! */ - RET_BCO, - RET_LBL(stg_ctoi_R1p), - RET_LBL(stg_ctoi_R1p), - RET_LBL(stg_ctoi_R1p), - RET_LBL(stg_ctoi_R1p), - RET_LBL(stg_ctoi_R1p), - RET_LBL(stg_ctoi_R1p), - RET_LBL(stg_ctoi_R1p), - RET_LBL(stg_ctoi_R1p)) + RET_BCO) { Sp_adj(-2); Sp(1) = R1; @@ -84,10 +67,6 @@ INFO_TABLE_RET( stg_ctoi_R1p, jump stg_yield_to_interpreter; } -#if MAX_VECTORED_RTN != 8 -#error MAX_VECTORED_RTN has changed: please modify stg_ctoi_R1p too. -#endif - /* * When the returned value is a pointer, but unlifted, in R1 ... */ @@ -194,10 +173,10 @@ INFO_TABLE_FUN( stg_BCO, 4, 0, BCO, "BCO", "BCO", ARG_BCO ) /* ---------------------------------------------------------------------------- Info tables for indirections. - SPECIALISED INDIRECTIONS: we have a specialised indirection for each - kind of return (direct, vectored 0-7), so that we can avoid entering - the object when we know what kind of return it will do. The update - code (Updates.hc) updates objects with the appropriate kind of + SPECIALISED INDIRECTIONS: we have a specialised indirection for direct returns, + so that we can avoid entering + the object when we know it points directly to a value. The update + code (Updates.cmm) updates objects with the appropriate kind of indirection. We only do this for young-gen indirections. ------------------------------------------------------------------------- */ @@ -209,25 +188,14 @@ INFO_TABLE(stg_IND,1,0,IND,"IND","IND") jump %GET_ENTRY(R1); } -#define IND_SPEC(label,ret) \ -INFO_TABLE(label,1,0,IND,"IND","IND") \ -{ \ - TICK_ENT_DYN_IND(); /* tick */ \ - R1 = StgInd_indirectee(R1); \ - TICK_ENT_VIA_NODE(); \ - jump ret; \ +INFO_TABLE(stg_IND_direct,1,0,IND,"IND","IND") +{ + TICK_ENT_DYN_IND(); /* tick */ + R1 = StgInd_indirectee(R1); + TICK_ENT_VIA_NODE(); + jump %ENTRY_CODE(Sp(0)); } -IND_SPEC(stg_IND_direct, %ENTRY_CODE(Sp(0))) -IND_SPEC(stg_IND_0, %RET_VEC(Sp(0),0)) -IND_SPEC(stg_IND_1, %RET_VEC(Sp(0),1)) -IND_SPEC(stg_IND_2, %RET_VEC(Sp(0),2)) -IND_SPEC(stg_IND_3, %RET_VEC(Sp(0),3)) -IND_SPEC(stg_IND_4, %RET_VEC(Sp(0),4)) -IND_SPEC(stg_IND_5, %RET_VEC(Sp(0),5)) -IND_SPEC(stg_IND_6, %RET_VEC(Sp(0),6)) -IND_SPEC(stg_IND_7, %RET_VEC(Sp(0),7)) - INFO_TABLE(stg_IND_STATIC,1,0,IND_STATIC,"IND_STATIC","IND_STATIC") { TICK_ENT_STATIC_IND(); /* tick */ diff --git a/rts/StgStartup.cmm b/rts/StgStartup.cmm index 2f2a759c81..33345cfcc5 100644 --- a/rts/StgStartup.cmm +++ b/rts/StgStartup.cmm @@ -34,11 +34,6 @@ /* ----------------------------------------------------------------------------- Returning from the STG world. - - This is a polymorphic return address, meaning that any old constructor - can be returned, we don't care (actually, it's probably going to be - an IOok constructor, which will indirect through the vector table - slot 0). -------------------------------------------------------------------------- */ #if defined(PROFILING) @@ -49,18 +44,8 @@ #define STOP_THREAD_WORDS 0 #endif -/* A polymorhpic return address, where all the vector slots point to the - direct entry point. */ INFO_TABLE_RET( stg_stop_thread, STOP_THREAD_WORDS, STOP_THREAD_BITMAP, - STOP_FRAME, - RET_LBL(stg_stop_thread), - RET_LBL(stg_stop_thread), - RET_LBL(stg_stop_thread), - RET_LBL(stg_stop_thread), - RET_LBL(stg_stop_thread), - RET_LBL(stg_stop_thread), - RET_LBL(stg_stop_thread), - RET_LBL(stg_stop_thread) ) + STOP_FRAME) { /* The final exit. diff --git a/rts/Ticky.c b/rts/Ticky.c index d6ac172e51..89013317c0 100644 --- a/rts/Ticky.c +++ b/rts/Ticky.c @@ -240,9 +240,6 @@ PrintTickyInfo(void) fprintf(tf,"%7ld (%5.1f%%) from entering a new constructor\n\t\t [the rest from entering an existing constructor]\n", tot_returns_of_new, PC(INTAVG(tot_returns_of_new,tot_returns))); - fprintf(tf,"%7ld (%5.1f%%) vectored [the rest unvectored]\n", - VEC_RETURN_ctr, - PC(INTAVG(VEC_RETURN_ctr,tot_returns))); /* krc: comment out some of this stuff temporarily */ @@ -260,10 +257,6 @@ PrintTickyInfo(void) PC(INTAVG(RET_UNBOXED_TUP_hst[i], RET_UNBOXED_TUP_ctr))); } fprintf(tf, "\n"); - fprintf(tf, "\nRET_VEC_RETURN : %7ld: ", VEC_RETURN_ctr); - for (i = 0; i < 9; i++) { fprintf(tf, "%5.1f%%", - PC(INTAVG(RET_VEC_RETURN_hst[i],VEC_RETURN_ctr))); } - fprintf(tf, "\n"); */ fprintf(tf,"\nUPDATE FRAMES: %ld (%ld omitted from thunks)", @@ -519,7 +512,6 @@ PrintTickyInfo(void) PR_CTR(RET_NEW_ctr); PR_CTR(RET_OLD_ctr); PR_CTR(RET_UNBOXED_TUP_ctr); - PR_CTR(VEC_RETURN_ctr); /* krc: put off till later... */ #if FALSE @@ -550,15 +542,6 @@ PrintTickyInfo(void) PR_HST(RET_UNBOXED_TUP_hst,6); PR_HST(RET_UNBOXED_TUP_hst,7); PR_HST(RET_UNBOXED_TUP_hst,8); - PR_HST(RET_VEC_RETURN_hst,0); - PR_HST(RET_VEC_RETURN_hst,1); - PR_HST(RET_VEC_RETURN_hst,2); - PR_HST(RET_VEC_RETURN_hst,3); - PR_HST(RET_VEC_RETURN_hst,4); - PR_HST(RET_VEC_RETURN_hst,5); - PR_HST(RET_VEC_RETURN_hst,6); - PR_HST(RET_VEC_RETURN_hst,7); - PR_HST(RET_VEC_RETURN_hst,8); #endif /* FALSE */ PR_CTR(UPDF_OMITTED_ctr); diff --git a/rts/Updates.cmm b/rts/Updates.cmm index 6265f90dcb..a9f25b76fb 100644 --- a/rts/Updates.cmm +++ b/rts/Updates.cmm @@ -15,20 +15,6 @@ #include "Updates.h" #include "StgLdvProf.h" -/* - The update frame return address must be *polymorphic*, that means - we have to cope with both vectored and non-vectored returns. This - is done by putting the return vector right before the info table, and - having a standard direct return address after the info table (pointed - to by the return address itself, as usual). - - Each entry in the vector table points to a specialised entry code fragment - that knows how to return after doing the update. It would be possible to - use a single generic piece of code that simply entered the return value - to return, but it's quicker this way. The direct return code of course - just does another direct return when it's finished. -*/ - /* on entry to the update code (1) R1 points to the closure being returned (2) Sp points to the update frame @@ -43,8 +29,7 @@ code), since we don't mind duplicating this jump. */ -#define UPD_FRAME_ENTRY_TEMPLATE(label,ind_info,ret) \ - label \ +#define UPD_FRAME_ENTRY_TEMPLATE \ { \ W_ updatee; \ \ @@ -56,27 +41,9 @@ /* ToDo: it might be a PAP, so we should check... */ \ TICK_UPD_CON_IN_NEW(sizeW_fromITBL(%GET_STD_INFO(updatee))); \ \ - UPD_SPEC_IND(updatee, ind_info, R1, jump (ret)); \ + UPD_SPEC_IND(updatee, stg_IND_direct_info, R1, jump %ENTRY_CODE(Sp(0))); \ } -UPD_FRAME_ENTRY_TEMPLATE(stg_upd_frame_0_ret,stg_IND_0_info,%RET_VEC(Sp(0),0)) -UPD_FRAME_ENTRY_TEMPLATE(stg_upd_frame_1_ret,stg_IND_1_info,%RET_VEC(Sp(0),1)) -UPD_FRAME_ENTRY_TEMPLATE(stg_upd_frame_2_ret,stg_IND_2_info,%RET_VEC(Sp(0),2)) -UPD_FRAME_ENTRY_TEMPLATE(stg_upd_frame_3_ret,stg_IND_3_info,%RET_VEC(Sp(0),3)) -UPD_FRAME_ENTRY_TEMPLATE(stg_upd_frame_4_ret,stg_IND_4_info,%RET_VEC(Sp(0),4)) -UPD_FRAME_ENTRY_TEMPLATE(stg_upd_frame_5_ret,stg_IND_5_info,%RET_VEC(Sp(0),5)) -UPD_FRAME_ENTRY_TEMPLATE(stg_upd_frame_6_ret,stg_IND_6_info,%RET_VEC(Sp(0),6)) -UPD_FRAME_ENTRY_TEMPLATE(stg_upd_frame_7_ret,stg_IND_7_info,%RET_VEC(Sp(0),7)) - -#if MAX_VECTORED_RTN > 8 -#error MAX_VECTORED_RTN has changed: please modify stg_upd_frame too. -#endif - -/* - Make sure this table is big enough to handle the maximum vectored - return size! - */ - #if defined(PROFILING) #define UPD_FRAME_BITMAP 3 #define UPD_FRAME_WORDS 3 @@ -91,64 +58,10 @@ UPD_FRAME_ENTRY_TEMPLATE(stg_upd_frame_7_ret,stg_IND_7_info,%RET_VEC(Sp(0),7)) */ INFO_TABLE_RET( stg_upd_frame, - UPD_FRAME_WORDS, UPD_FRAME_BITMAP, UPDATE_FRAME, - stg_upd_frame_0_ret, - stg_upd_frame_1_ret, - stg_upd_frame_2_ret, - stg_upd_frame_3_ret, - stg_upd_frame_4_ret, - stg_upd_frame_5_ret, - stg_upd_frame_6_ret, - stg_upd_frame_7_ret - ) -UPD_FRAME_ENTRY_TEMPLATE(,stg_IND_direct_info,%ENTRY_CODE(Sp(0))) + UPD_FRAME_WORDS, UPD_FRAME_BITMAP, UPDATE_FRAME) +UPD_FRAME_ENTRY_TEMPLATE INFO_TABLE_RET( stg_marked_upd_frame, - UPD_FRAME_WORDS, UPD_FRAME_BITMAP, UPDATE_FRAME, - stg_upd_frame_0_ret, - stg_upd_frame_1_ret, - stg_upd_frame_2_ret, - stg_upd_frame_3_ret, - stg_upd_frame_4_ret, - stg_upd_frame_5_ret, - stg_upd_frame_6_ret, - stg_upd_frame_7_ret - ) -UPD_FRAME_ENTRY_TEMPLATE(,stg_IND_direct_info,%ENTRY_CODE(Sp(0))) - -/*----------------------------------------------------------------------------- - Seq frames - - We don't have a primitive seq# operator: it is just a 'case' - expression whose scrutinee has either a polymorphic or function type - (constructor types can be handled by normal 'case' expressions). - - To handle a polymorphic/function typed seq, we push a SEQ frame on - the stack. This is a polymorphic activation record that just pops - itself and returns (in a non-vectored way) when entered. The - purpose of the SEQ frame is to avoid having to make a polymorphic return - point for each polymorphic case expression. - - Another way of looking at it: the SEQ frame turns a vectored return - into a direct one. - -------------------------------------------------------------------------- */ - -#if MAX_VECTORED_RTN > 8 -#error MAX_VECTORED_RTN has changed: please modify stg_seq_frame too. -#endif - -INFO_TABLE_RET( stg_seq_frame, 0/* words */, 0/* bitmap */, RET_SMALL, - RET_LBL(stg_seq_frame), /* 0 */ - RET_LBL(stg_seq_frame), /* 1 */ - RET_LBL(stg_seq_frame), /* 2 */ - RET_LBL(stg_seq_frame), /* 3 */ - RET_LBL(stg_seq_frame), /* 4 */ - RET_LBL(stg_seq_frame), /* 5 */ - RET_LBL(stg_seq_frame), /* 6 */ - RET_LBL(stg_seq_frame) /* 7 */ - ) -{ - Sp_adj(1); - jump %ENTRY_CODE(Sp(0)); -} + UPD_FRAME_WORDS, UPD_FRAME_BITMAP, UPDATE_FRAME) +UPD_FRAME_ENTRY_TEMPLATE diff --git a/rts/sm/Compact.c b/rts/sm/Compact.c index 62d9152898..feebef87aa 100644 --- a/rts/sm/Compact.c +++ b/rts/sm/Compact.c @@ -266,7 +266,6 @@ thread_stack(StgPtr p, StgPtr stack_end) case STOP_FRAME: case CATCH_FRAME: case RET_SMALL: - case RET_VEC_SMALL: bitmap = BITMAP_BITS(info->i.layout.bitmap); size = BITMAP_SIZE(info->i.layout.bitmap); p++; @@ -298,7 +297,6 @@ thread_stack(StgPtr p, StgPtr stack_end) // large bitmap (> 32 entries, or 64 on a 64-bit machine) case RET_BIG: - case RET_VEC_BIG: p++; size = GET_LARGE_BITMAP(&info->i)->size; thread_large_bitmap(p, GET_LARGE_BITMAP(&info->i), size); diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c index 6ca7d85fc2..dda5659675 100644 --- a/rts/sm/Evac.c +++ b/rts/sm/Evac.c @@ -546,9 +546,7 @@ loop: case RET_BCO: case RET_SMALL: - case RET_VEC_SMALL: case RET_BIG: - case RET_VEC_BIG: case RET_DYN: case UPDATE_FRAME: case STOP_FRAME: diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c index 139ecad53f..0de029edd5 100644 --- a/rts/sm/Scav.c +++ b/rts/sm/Scav.c @@ -1649,7 +1649,6 @@ scavenge_stack(StgPtr p, StgPtr stack_end) case STOP_FRAME: case CATCH_FRAME: case RET_SMALL: - case RET_VEC_SMALL: bitmap = BITMAP_BITS(info->i.layout.bitmap); size = BITMAP_SIZE(info->i.layout.bitmap); // NOTE: the payload starts immediately after the info-ptr, we @@ -1678,7 +1677,6 @@ scavenge_stack(StgPtr p, StgPtr stack_end) // large bitmap (> 32 entries, or > 64 on a 64-bit machine) case RET_BIG: - case RET_VEC_BIG: { nat size; |