From 70a2431f90fa932733ce015714ef7848640ed48f Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Thu, 1 Apr 2010 09:35:19 +0000 Subject: [PATCH] Remove the IND_OLDGEN and IND_OLDGEN_PERM closure types These are no longer used: once upon a time they used to have different layout from IND and IND_PERM respectively, but that is no longer the case since we changed the remembered set to be an array of addresses instead of a linked list of closures. --- includes/Cmm.h | 2 -- includes/rts/storage/ClosureMacros.h | 2 -- includes/rts/storage/ClosureTypes.h | 64 ++++++++++++++++------------------ includes/stg/MiscClosures.h | 2 -- rts/ClosureFlags.c | 4 +-- rts/FrontPanel.c | 1 - rts/Interpreter.c | 2 -- rts/LdvProfile.c | 8 ++--- rts/Printer.c | 18 +--------- rts/ProfHeap.c | 2 -- rts/RetainerProfile.c | 6 ---- rts/Stable.c | 4 +-- rts/StgMiscClosures.cmm | 39 --------------------- rts/Updates.h | 4 +-- rts/sm/Compact.c | 2 -- rts/sm/Evac.c | 6 ---- rts/sm/GCAux.c | 2 -- rts/sm/Sanity.c | 2 -- rts/sm/Scav.c | 21 ----------- utils/genapply/GenApply.hs | 6 +--- 20 files changed, 40 insertions(+), 157 deletions(-) diff --git a/includes/Cmm.h b/includes/Cmm.h index ff91146..183e103 100644 --- a/includes/Cmm.h +++ b/includes/Cmm.h @@ -295,9 +295,7 @@ (TO_W_( %INFO_TYPE(%STD_INFO(info)) )) { \ case \ IND, \ - IND_OLDGEN, \ IND_PERM, \ - IND_OLDGEN_PERM, \ IND_STATIC: \ { \ P1 = StgInd_indirectee(P1); \ diff --git a/includes/rts/storage/ClosureMacros.h b/includes/rts/storage/ClosureMacros.h index 098c65d..56e7dca 100644 --- a/includes/rts/storage/ClosureMacros.h +++ b/includes/rts/storage/ClosureMacros.h @@ -327,8 +327,6 @@ closure_sizeW_ (StgClosure *p, StgInfoTable *info) return pap_sizeW((StgPAP *)p); case IND: case IND_PERM: - case IND_OLDGEN: - case IND_OLDGEN_PERM: return sizeofW(StgInd); case ARR_WORDS: return arr_words_sizeW((StgArrWords *)p); diff --git a/includes/rts/storage/ClosureTypes.h b/includes/rts/storage/ClosureTypes.h index 518d39b..8d09e69 100644 --- a/includes/rts/storage/ClosureTypes.h +++ b/includes/rts/storage/ClosureTypes.h @@ -50,38 +50,36 @@ #define PAP 26 #define AP_STACK 27 #define IND 28 -#define IND_OLDGEN 29 -#define IND_PERM 30 -#define IND_OLDGEN_PERM 31 -#define IND_STATIC 32 -#define RET_BCO 33 -#define RET_SMALL 34 -#define RET_BIG 35 -#define RET_DYN 36 -#define RET_FUN 37 -#define UPDATE_FRAME 38 -#define CATCH_FRAME 39 -#define STOP_FRAME 40 -#define BLOCKING_QUEUE 41 -#define BLACKHOLE 42 -#define MVAR_CLEAN 43 -#define MVAR_DIRTY 44 -#define ARR_WORDS 45 -#define MUT_ARR_PTRS_CLEAN 46 -#define MUT_ARR_PTRS_DIRTY 47 -#define MUT_ARR_PTRS_FROZEN0 48 -#define MUT_ARR_PTRS_FROZEN 49 -#define MUT_VAR_CLEAN 50 -#define MUT_VAR_DIRTY 51 -#define WEAK 52 -#define PRIM 53 -#define MUT_PRIM 54 -#define TSO 55 -#define TREC_CHUNK 56 -#define ATOMICALLY_FRAME 57 -#define CATCH_RETRY_FRAME 58 -#define CATCH_STM_FRAME 59 -#define WHITEHOLE 60 -#define N_CLOSURE_TYPES 61 +#define IND_PERM 29 +#define IND_STATIC 30 +#define RET_BCO 31 +#define RET_SMALL 32 +#define RET_BIG 33 +#define RET_DYN 34 +#define RET_FUN 35 +#define UPDATE_FRAME 36 +#define CATCH_FRAME 37 +#define STOP_FRAME 38 +#define BLOCKING_QUEUE 39 +#define BLACKHOLE 40 +#define MVAR_CLEAN 41 +#define MVAR_DIRTY 42 +#define ARR_WORDS 43 +#define MUT_ARR_PTRS_CLEAN 44 +#define MUT_ARR_PTRS_DIRTY 45 +#define MUT_ARR_PTRS_FROZEN0 46 +#define MUT_ARR_PTRS_FROZEN 47 +#define MUT_VAR_CLEAN 48 +#define MUT_VAR_DIRTY 49 +#define WEAK 50 +#define PRIM 51 +#define MUT_PRIM 52 +#define TSO 53 +#define TREC_CHUNK 54 +#define ATOMICALLY_FRAME 55 +#define CATCH_RETRY_FRAME 56 +#define CATCH_STM_FRAME 57 +#define WHITEHOLE 58 +#define N_CLOSURE_TYPES 59 #endif /* RTS_STORAGE_CLOSURETYPES_H */ diff --git a/includes/stg/MiscClosures.h b/includes/stg/MiscClosures.h index 0aa6f99..9b2bb60 100644 --- a/includes/stg/MiscClosures.h +++ b/includes/stg/MiscClosures.h @@ -83,8 +83,6 @@ RTS_ENTRY(stg_IND); RTS_ENTRY(stg_IND_direct); RTS_ENTRY(stg_IND_STATIC); RTS_ENTRY(stg_IND_PERM); -RTS_ENTRY(stg_IND_OLDGEN); -RTS_ENTRY(stg_IND_OLDGEN_PERM); RTS_ENTRY(stg_BLACKHOLE); RTS_ENTRY(stg_CAF_BLACKHOLE); RTS_ENTRY(__stg_EAGER_BLACKHOLE); diff --git a/rts/ClosureFlags.c b/rts/ClosureFlags.c index cebd124..d5181ca 100644 --- a/rts/ClosureFlags.c +++ b/rts/ClosureFlags.c @@ -50,9 +50,7 @@ StgWord16 closure_flags[] = { [PAP] = (_HNF| _NS ), [AP_STACK] = ( _THU ), [IND] = ( _NS| _IND ), - [IND_OLDGEN] = ( _NS| _IND ), [IND_PERM] = ( _NS| _IND ), - [IND_OLDGEN_PERM] = ( _NS| _IND ), [IND_STATIC] = ( _NS|_STA| _IND ), [RET_BCO] = ( _BTM ), [RET_SMALL] = ( _BTM| _SRT ), @@ -84,6 +82,6 @@ StgWord16 closure_flags[] = { [WHITEHOLE] = ( 0 ) }; -#if N_CLOSURE_TYPES != 61 +#if N_CLOSURE_TYPES != 59 #error Closure types changed: update ClosureFlags.c! #endif diff --git a/rts/FrontPanel.c b/rts/FrontPanel.c index da42548..d6269fb 100644 --- a/rts/FrontPanel.c +++ b/rts/FrontPanel.c @@ -700,7 +700,6 @@ residencyCensus( void ) case MUT_VAR: /* case MUT_CONS: FIXME: case does not exist */ case IND_PERM: - case IND_OLDGEN_PERM: size = sizeW_fromITBL(info); type = Other; break; diff --git a/rts/Interpreter.c b/rts/Interpreter.c index 16a8e24..5a564ba 100644 --- a/rts/Interpreter.c +++ b/rts/Interpreter.c @@ -276,9 +276,7 @@ eval_obj: switch ( get_itbl(obj)->type ) { case IND: - case IND_OLDGEN: case IND_PERM: - case IND_OLDGEN_PERM: case IND_STATIC: { tagged_obj = ((StgInd*)obj)->indirectee; diff --git a/rts/LdvProfile.c b/rts/LdvProfile.c index 799d418..021ecf0 100644 --- a/rts/LdvProfile.c +++ b/rts/LdvProfile.c @@ -142,18 +142,16 @@ processHeapClosureForDead( StgClosure *c ) case BLACKHOLE: case BLOCKING_QUEUE: case IND_PERM: - case IND_OLDGEN_PERM: /* 'Ingore' cases */ - // Why can we ignore IND/IND_OLDGEN closures? We assume that + // Why can we ignore IND closures? We assume that // any census is preceded by a major garbage collection, which - // IND/IND_OLDGEN closures cannot survive. Therefore, it is no - // use considering IND/IND_OLDGEN closures in the meanwhile + // IND closures cannot survive. Therefore, it is no + // use considering IND closures in the meanwhile // because they will perish before the next census at any // rate. case IND: - case IND_OLDGEN: // Found a dead closure: record its size LDV_recordDead(c, size); return size; diff --git a/rts/Printer.c b/rts/Printer.c index 6eecfab..6ab4b7e 100644 --- a/rts/Printer.c +++ b/rts/Printer.c @@ -233,24 +233,12 @@ printClosure( StgClosure *obj ) debugBelch(")\n"); break; - case IND_OLDGEN: - debugBelch("IND_OLDGEN("); - printPtr((StgPtr)((StgInd*)obj)->indirectee); - debugBelch(")\n"); - break; - case IND_PERM: debugBelch("IND("); printPtr((StgPtr)((StgInd*)obj)->indirectee); debugBelch(")\n"); break; - case IND_OLDGEN_PERM: - debugBelch("IND_OLDGEN_PERM("); - printPtr((StgPtr)((StgInd*)obj)->indirectee); - debugBelch(")\n"); - break; - case IND_STATIC: debugBelch("IND_STATIC("); printPtr((StgPtr)((StgInd*)obj)->indirectee); @@ -994,9 +982,7 @@ void prettyPrintClosure_ (StgClosure *obj) while (type == IND || type == IND_STATIC || - type == IND_OLDGEN || - type == IND_PERM || - type == IND_OLDGEN_PERM) + type == IND_PERM) { obj = ((StgInd *)obj)->indirectee; type = get_itbl(obj)->type; @@ -1108,9 +1094,7 @@ char *closure_type_names[] = { [PAP] = "PAP", [AP_STACK] = "AP_STACK", [IND] = "IND", - [IND_OLDGEN] = "IND_OLDGEN", [IND_PERM] = "IND_PERM", - [IND_OLDGEN_PERM] = "IND_OLDGEN_PERM", [IND_STATIC] = "IND_STATIC", [RET_BCO] = "RET_BCO", [RET_SMALL] = "RET_SMALL", diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c index 4a2816c..d398afd 100644 --- a/rts/ProfHeap.c +++ b/rts/ProfHeap.c @@ -876,8 +876,6 @@ heapCensusChain( Census *census, bdescr *bd ) case CONSTR: case FUN: case IND_PERM: - case IND_OLDGEN: - case IND_OLDGEN_PERM: case BLACKHOLE: case BLOCKING_QUEUE: case FUN_1_0: diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c index b5db15a..d14ba06 100644 --- a/rts/RetainerProfile.c +++ b/rts/RetainerProfile.c @@ -466,8 +466,6 @@ push( StgClosure *c, retainer c_child_r, StgClosure **first_child ) *first_child = ((StgSelector *)c)->selectee; return; case IND_PERM: - case IND_OLDGEN_PERM: - case IND_OLDGEN: case BLACKHOLE: *first_child = ((StgInd *)c)->indirectee; return; @@ -921,8 +919,6 @@ pop( StgClosure **c, StgClosure **cp, retainer *r ) case MUT_VAR_DIRTY: case THUNK_SELECTOR: case IND_PERM: - case IND_OLDGEN_PERM: - case IND_OLDGEN: case CONSTR_1_1: // cannot appear case PAP: @@ -1058,8 +1054,6 @@ isRetainer( StgClosure *c ) case PAP: // indirection case IND_PERM: - case IND_OLDGEN_PERM: - case IND_OLDGEN: case BLACKHOLE: // static objects case CONSTR_STATIC: diff --git a/rts/Stable.c b/rts/Stable.c index b427c94..c46f8b2 100644 --- a/rts/Stable.c +++ b/rts/Stable.c @@ -188,9 +188,7 @@ removeIndirections(StgClosure* p) while (get_itbl(q)->type == IND || get_itbl(q)->type == IND_STATIC || - get_itbl(q)->type == IND_OLDGEN || - get_itbl(q)->type == IND_PERM || - get_itbl(q)->type == IND_OLDGEN_PERM ) { + get_itbl(q)->type == IND_PERM) { q = ((StgInd *)q)->indirectee; tag = GET_CLOSURE_TAG(q); q = UNTAG_CLOSURE(q); diff --git a/rts/StgMiscClosures.cmm b/rts/StgMiscClosures.cmm index 1dec6e6..1bc6dc6 100644 --- a/rts/StgMiscClosures.cmm +++ b/rts/StgMiscClosures.cmm @@ -235,45 +235,6 @@ INFO_TABLE(stg_IND_PERM,1,0,IND_PERM,"IND_PERM","IND_PERM") jump %GET_ENTRY(R1); } - -INFO_TABLE(stg_IND_OLDGEN,1,0,IND_OLDGEN,"IND_OLDGEN","IND_OLDGEN") -{ - TICK_ENT_STATIC_IND(); /* tick */ - R1 = UNTAG(StgInd_indirectee(R1)); - TICK_ENT_VIA_NODE(); - jump %GET_ENTRY(R1); -} - -INFO_TABLE(stg_IND_OLDGEN_PERM,1,0,IND_OLDGEN_PERM,"IND_OLDGEN_PERM","IND_OLDGEN_PERM") -{ - /* Don't: TICK_ENT_STATIC_IND(Node); for ticky-ticky; - this ind is here only to help profiling */ - -#if defined(TICKY_TICKY) && !defined(PROFILING) - /* TICKY_TICKY && !PROFILING means PERM_IND *replaces* an IND, - rather than being extra */ - TICK_ENT_PERM_IND(); /* tick */ -#endif - - LDV_ENTER(R1); - - /* Enter PAP cost centre -- lexical scoping only */ - ENTER_CCS_PAP_CL(R1); - - /* see comment in IND_PERM */ -#ifdef TICKY_TICKY -# ifdef PROFILING -# error Profiling and ticky-ticky do not mix at present! -# endif /* PROFILING */ - StgHeader_info(R1) = stg_IND_OLDGEN_info; -#endif /* TICKY_TICKY */ - - R1 = UNTAG(StgInd_indirectee(R1)); - - TICK_ENT_VIA_NODE(); - jump %GET_ENTRY(R1); -} - /* ---------------------------------------------------------------------------- Black holes. diff --git a/rts/Updates.h b/rts/Updates.h index de9276c..4872adf 100644 --- a/rts/Updates.h +++ b/rts/Updates.h @@ -22,8 +22,8 @@ BEGIN_RTS_PRIVATE * which p1 resides. * * Note: - * After all, we do *NOT* need to call LDV_RECORD_CREATE() for both IND and - * IND_OLDGEN closures because they are inherently used. But, it corrupts + * After all, we do *NOT* need to call LDV_RECORD_CREATE() for IND + * closures because they are inherently used. But, it corrupts * the invariants that every closure keeps its creation time in the profiling * field. So, we call LDV_RECORD_CREATE(). */ diff --git a/rts/sm/Compact.c b/rts/sm/Compact.c index 7eeb90f..fd6c92f 100644 --- a/rts/sm/Compact.c +++ b/rts/sm/Compact.c @@ -664,8 +664,6 @@ thread_obj (StgInfoTable *info, StgPtr p) case IND: case IND_PERM: - case IND_OLDGEN: - case IND_OLDGEN_PERM: thread(&((StgInd *)p)->indirectee); return p + sizeofW(StgInd); diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c index 9577b2d..61cf10b 100644 --- a/rts/sm/Evac.c +++ b/rts/sm/Evac.c @@ -620,7 +620,6 @@ loop: case FUN: case IND_PERM: - case IND_OLDGEN_PERM: case CONSTR: copy_tag_nolock(p,info,q,sizeW_fromITBL(INFO_PTR_TO_STRUCT(info)),gen,tag); return; @@ -666,7 +665,6 @@ loop: return; case IND: - case IND_OLDGEN: // follow chains of indirections, don't evacuate them q = ((StgInd*)q)->indirectee; *p = q; @@ -971,8 +969,6 @@ selector_loop: switch (info->type) { case IND: case IND_PERM: - case IND_OLDGEN: - case IND_OLDGEN_PERM: case IND_STATIC: val = ((StgInd *)val)->indirectee; goto val_loop; @@ -1006,8 +1002,6 @@ selector_loop: case IND: case IND_PERM: - case IND_OLDGEN: - case IND_OLDGEN_PERM: case IND_STATIC: // Again, we might need to untag a constructor. selectee = UNTAG_CLOSURE( ((StgInd *)selectee)->indirectee ); diff --git a/rts/sm/GCAux.c b/rts/sm/GCAux.c index 0fb8e1f..cbbb8b6 100644 --- a/rts/sm/GCAux.c +++ b/rts/sm/GCAux.c @@ -90,8 +90,6 @@ isAlive(StgClosure *p) case IND: case IND_STATIC: case IND_PERM: - case IND_OLDGEN: // rely on compatible layout with StgInd - case IND_OLDGEN_PERM: // follow indirections p = ((StgInd *)q)->indirectee; continue; diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c index 2069711..a2cdfc0 100644 --- a/rts/sm/Sanity.c +++ b/rts/sm/Sanity.c @@ -303,8 +303,6 @@ checkClosure( StgClosure* p ) case CONSTR_0_2: case CONSTR_2_0: case IND_PERM: - case IND_OLDGEN: - case IND_OLDGEN_PERM: case BLACKHOLE: case PRIM: case MUT_PRIM: diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c index ae9e81c..54bf47c 100644 --- a/rts/sm/Scav.c +++ b/rts/sm/Scav.c @@ -550,23 +550,6 @@ scavenge_block (bdescr *bd) } case IND_PERM: - if (bd->gen_no != 0) { -#ifdef PROFILING - // @LDV profiling - // No need to call LDV_recordDead_FILL_SLOP_DYNAMIC() because an - // IND_OLDGEN_PERM closure is larger than an IND_PERM closure. - LDV_recordDead((StgClosure *)p, sizeofW(StgInd)); -#endif - // - // Todo: maybe use SET_HDR() and remove LDV_RECORD_CREATE()? - // - SET_INFO(((StgClosure *)p), &stg_IND_OLDGEN_PERM_info); - - // We pretend that p has just been created. - LDV_RECORD_CREATE((StgClosure *)p); - } - // fall through - case IND_OLDGEN_PERM: case BLACKHOLE: evacuate(&((StgInd *)p)->indirectee); p += sizeofW(StgInd); @@ -896,8 +879,6 @@ scavenge_mark_stack(void) break; case IND: - case IND_OLDGEN: - case IND_OLDGEN_PERM: case BLACKHOLE: evacuate(&((StgInd *)p)->indirectee); break; @@ -1284,8 +1265,6 @@ scavenge_one(StgPtr p) // IND can happen, for example, when the interpreter allocates // a gigantic AP closure (more than one block), which ends up // on the large-object list and then gets updated. See #3424. - case IND_OLDGEN: - case IND_OLDGEN_PERM: case BLACKHOLE: case IND_STATIC: evacuate(&((StgInd *)p)->indirectee); diff --git a/utils/genapply/GenApply.hs b/utils/genapply/GenApply.hs index 16d3394..d9e6041 100644 --- a/utils/genapply/GenApply.hs +++ b/utils/genapply/GenApply.hs @@ -467,10 +467,8 @@ genApply regstatus args = -- print " [THUNK_STATIC] &&thunk_lbl," -- print " [THUNK_SELECTOR] &&thunk_lbl," -- print " [IND] &&ind_lbl," --- print " [IND_OLDGEN] &&ind_lbl," -- print " [IND_STATIC] &&ind_lbl," -- print " [IND_PERM] &&ind_lbl," --- print " [IND_OLDGEN_PERM] &&ind_lbl" -- print " };" tickForArity (length args), @@ -590,10 +588,8 @@ genApply regstatus args = -- print " ind_lbl:" -- else: text "case IND,", - text " IND_OLDGEN,", text " IND_STATIC,", - text " IND_PERM,", - text " IND_OLDGEN_PERM: {", + text " IND_PERM: {", nest 4 (vcat [ text "R1 = StgInd_indirectee(R1);", -- An indirection node might contain a tagged pointer -- 1.7.10.4