Commit f42db157 authored by Joachim Breitner's avatar Joachim Breitner Committed by Ben Gamari

Remove unused IND_PERM

it seems that this closure type has not been in use since 5d52d9, so all
this is dead and untested code. This removes it. Some of the code might
be useful for a counting indirection as described in #10613, so when
implementing that, have a look at what this commit removes.

Test Plan: validate on harbormaster

Reviewers: austin, bgamari, simonmar

Reviewed By: simonmar

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D1821
parent 4e04043d
......@@ -288,7 +288,6 @@
(TO_W_( %INFO_TYPE(%STD_INFO(info)) )) { \
case \
IND, \
IND_PERM, \
IND_STATIC: \
{ \
x = StgInd_indirectee(x); \
......
......@@ -378,7 +378,6 @@ closure_sizeW_ (StgClosure *p, StgInfoTable *info)
case PAP:
return pap_sizeW((StgPAP *)p);
case IND:
case IND_PERM:
return sizeofW(StgInd);
case ARR_WORDS:
return arr_words_sizeW((StgArrBytes *)p);
......
......@@ -47,42 +47,41 @@
#define PAP 26
#define AP_STACK 27
#define IND 28
#define IND_PERM 29
#define IND_STATIC 30
#define RET_BCO 31
#define RET_SMALL 32
#define RET_BIG 33
#define RET_FUN 34
#define UPDATE_FRAME 35
#define CATCH_FRAME 36
#define UNDERFLOW_FRAME 37
#define STOP_FRAME 38
#define BLOCKING_QUEUE 39
#define BLACKHOLE 40
#define MVAR_CLEAN 41
#define MVAR_DIRTY 42
#define TVAR 43
#define ARR_WORDS 44
#define MUT_ARR_PTRS_CLEAN 45
#define MUT_ARR_PTRS_DIRTY 46
#define MUT_ARR_PTRS_FROZEN0 47
#define MUT_ARR_PTRS_FROZEN 48
#define MUT_VAR_CLEAN 49
#define MUT_VAR_DIRTY 50
#define WEAK 51
#define PRIM 52
#define MUT_PRIM 53
#define TSO 54
#define STACK 55
#define TREC_CHUNK 56
#define ATOMICALLY_FRAME 57
#define CATCH_RETRY_FRAME 58
#define CATCH_STM_FRAME 59
#define WHITEHOLE 60
#define SMALL_MUT_ARR_PTRS_CLEAN 61
#define SMALL_MUT_ARR_PTRS_DIRTY 62
#define SMALL_MUT_ARR_PTRS_FROZEN0 63
#define SMALL_MUT_ARR_PTRS_FROZEN 64
#define N_CLOSURE_TYPES 65
#define IND_STATIC 29
#define RET_BCO 30
#define RET_SMALL 31
#define RET_BIG 32
#define RET_FUN 33
#define UPDATE_FRAME 34
#define CATCH_FRAME 35
#define UNDERFLOW_FRAME 36
#define STOP_FRAME 37
#define BLOCKING_QUEUE 38
#define BLACKHOLE 39
#define MVAR_CLEAN 40
#define MVAR_DIRTY 41
#define TVAR 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 STACK 54
#define TREC_CHUNK 55
#define ATOMICALLY_FRAME 56
#define CATCH_RETRY_FRAME 57
#define CATCH_STM_FRAME 58
#define WHITEHOLE 59
#define SMALL_MUT_ARR_PTRS_CLEAN 60
#define SMALL_MUT_ARR_PTRS_DIRTY 61
#define SMALL_MUT_ARR_PTRS_FROZEN0 62
#define SMALL_MUT_ARR_PTRS_FROZEN 63
#define N_CLOSURE_TYPES 64
#endif /* RTS_STORAGE_CLOSURETYPES_H */
......@@ -86,7 +86,6 @@ RTS_RET(stg_apply_interp);
RTS_ENTRY(stg_IND);
RTS_ENTRY(stg_IND_direct);
RTS_ENTRY(stg_IND_STATIC);
RTS_ENTRY(stg_IND_PERM);
RTS_ENTRY(stg_BLACKHOLE);
RTS_ENTRY(stg_CAF_BLACKHOLE);
RTS_ENTRY(__stg_EAGER_BLACKHOLE);
......
......@@ -136,7 +136,6 @@ static void searchHeapBlocks (HashTable *addrs, bdescr *bd)
size = sizeW_fromITBL(info);
break;
case IND_PERM:
case BLACKHOLE:
case BLOCKING_QUEUE:
prim = rtsTrue;
......
......@@ -50,7 +50,6 @@ StgWord16 closure_flags[] = {
[PAP] = (_HNF| _NS ),
[AP_STACK] = ( _THU ),
[IND] = ( _NS| _IND ),
[IND_PERM] = ( _NS| _IND ),
[IND_STATIC] = ( _NS|_STA| _IND ),
[RET_BCO] = ( 0 ),
[RET_SMALL] = ( _BTM| _SRT ),
......@@ -88,6 +87,6 @@ StgWord16 closure_flags[] = {
[SMALL_MUT_ARR_PTRS_FROZEN] = (_HNF| _NS| _UPT )
};
#if N_CLOSURE_TYPES != 65
#if N_CLOSURE_TYPES != 64
#error Closure types changed: update ClosureFlags.c!
#endif
......@@ -330,7 +330,6 @@ eval_obj:
switch ( get_itbl(obj)->type ) {
case IND:
case IND_PERM:
case IND_STATIC:
{
tagged_obj = ((StgInd*)obj)->indirectee;
......
......@@ -109,7 +109,6 @@ processHeapClosureForDead( StgClosure *c )
case FUN_0_2:
case BLACKHOLE:
case BLOCKING_QUEUE:
case IND_PERM:
/*
'Ingore' cases
*/
......
......@@ -232,12 +232,6 @@ printClosure( StgClosure *obj )
debugBelch(")\n");
break;
case IND_PERM:
debugBelch("IND(");
printPtr((StgPtr)((StgInd*)obj)->indirectee);
debugBelch(")\n");
break;
case IND_STATIC:
debugBelch("IND_STATIC(");
printPtr((StgPtr)((StgInd*)obj)->indirectee);
......@@ -814,8 +808,7 @@ void prettyPrintClosure_ (StgClosure *obj)
type = get_itbl(obj)->type;
while (type == IND ||
type == IND_STATIC ||
type == IND_PERM)
type == IND_STATIC)
{
obj = ((StgInd *)obj)->indirectee;
type = get_itbl(obj)->type;
......@@ -926,7 +919,6 @@ char *closure_type_names[] = {
[PAP] = "PAP",
[AP_STACK] = "AP_STACK",
[IND] = "IND",
[IND_PERM] = "IND_PERM",
[IND_STATIC] = "IND_STATIC",
[RET_BCO] = "RET_BCO",
[RET_SMALL] = "RET_SMALL",
......
......@@ -961,7 +961,6 @@ heapCensusChain( Census *census, bdescr *bd )
case CONSTR:
case FUN:
case IND_PERM:
case BLACKHOLE:
case BLOCKING_QUEUE:
case FUN_1_0:
......
......@@ -466,7 +466,6 @@ push( StgClosure *c, retainer c_child_r, StgClosure **first_child )
case THUNK_SELECTOR:
*first_child = ((StgSelector *)c)->selectee;
return;
case IND_PERM:
case BLACKHOLE:
*first_child = ((StgInd *)c)->indirectee;
return;
......@@ -934,7 +933,6 @@ pop( StgClosure **c, StgClosure **cp, retainer *r )
case MUT_VAR_CLEAN:
case MUT_VAR_DIRTY:
case THUNK_SELECTOR:
case IND_PERM:
case CONSTR_1_1:
// cannot appear
case PAP:
......@@ -1070,7 +1068,6 @@ isRetainer( StgClosure *c )
// partial applications
case PAP:
// indirection
case IND_PERM:
// IND_STATIC used to be an error, but at the moment it can happen
// as isAlive doesn't look through IND_STATIC as it ignores static
// closures. See trac #3956 for a program that hit this error.
......
......@@ -292,7 +292,6 @@ removeIndirections (StgClosure* p)
switch (get_itbl(q)->type) {
case IND:
case IND_STATIC:
case IND_PERM:
p = ((StgInd *)q)->indirectee;
continue;
......
......@@ -258,45 +258,6 @@ INFO_TABLE(stg_IND_STATIC,1,0,IND_STATIC,"IND_STATIC","IND_STATIC")
jump %GET_ENTRY(R1) [R1];
}
INFO_TABLE(stg_IND_PERM,1,0,IND_PERM,"IND_PERM","IND_PERM")
/* explicit stack */
{
/* Don't add INDs to granularity cost */
/* 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();
#endif
LDV_ENTER(R1);
/* For ticky-ticky, change the perm_ind to a normal ind on first
* entry, so the number of ent_perm_inds is the number of *thunks*
* entered again, not the number of subsequent entries.
*
* Since this screws up cost centres, we die if profiling and
* ticky_ticky are on at the same time. KSW 1999-01.
*/
#ifdef TICKY_TICKY
# ifdef PROFILING
# error Profiling and ticky-ticky do not mix at present!
# endif /* PROFILING */
StgHeader_info(R1) = stg_IND_info;
#endif /* TICKY_TICKY */
R1 = UNTAG(StgInd_indirectee(R1));
#if defined(TICKY_TICKY) && !defined(PROFILING)
TICK_ENT_VIA_NODE();
#endif
jump %GET_ENTRY(R1) [R1];
}
/* ----------------------------------------------------------------------------
Black holes.
......
......@@ -649,7 +649,6 @@ thread_obj (StgInfoTable *info, StgPtr p)
}
case IND:
case IND_PERM:
thread(&((StgInd *)p)->indirectee);
return p + sizeofW(StgInd);
......
......@@ -601,7 +601,6 @@ loop:
return;
case FUN:
case IND_PERM:
case CONSTR:
copy_tag_nolock(p,info,q,sizeW_fromITBL(INFO_PTR_TO_STRUCT(info)),gen_no,tag);
return;
......@@ -965,7 +964,6 @@ selector_loop:
info = INFO_PTR_TO_STRUCT((StgInfoTable *)info_ptr);
switch (info->type) {
case IND:
case IND_PERM:
case IND_STATIC:
val = ((StgInd *)val)->indirectee;
goto val_loop;
......@@ -998,7 +996,6 @@ selector_loop:
}
case IND:
case IND_PERM:
case IND_STATIC:
// Again, we might need to untag a constructor.
selectee = UNTAG_CLOSURE( ((StgInd *)selectee)->indirectee );
......
......@@ -88,7 +88,6 @@ isAlive(StgClosure *p)
case IND:
case IND_STATIC:
case IND_PERM:
// follow indirections
p = ((StgInd *)q)->indirectee;
continue;
......
......@@ -276,7 +276,6 @@ checkClosure( StgClosure* p )
case CONSTR_1_1:
case CONSTR_0_2:
case CONSTR_2_0:
case IND_PERM:
case BLACKHOLE:
case PRIM:
case MUT_PRIM:
......
......@@ -580,7 +580,6 @@ scavenge_block (bdescr *bd)
break;
}
case IND_PERM:
case BLACKHOLE:
evacuate(&((StgInd *)p)->indirectee);
p += sizeofW(StgInd);
......@@ -980,12 +979,6 @@ scavenge_mark_stack(void)
break;
}
case IND_PERM:
// don't need to do anything here: the only possible case
// is that we're in a 1-space compacting collector, with
// no "old" generation.
break;
case IND:
case BLACKHOLE:
evacuate(&((StgInd *)p)->indirectee);
......@@ -1295,7 +1288,6 @@ scavenge_one(StgPtr p)
case CONSTR_2_0:
case WEAK:
case PRIM:
case IND_PERM:
{
StgPtr q, end;
......
......@@ -632,7 +632,6 @@ genApply regstatus args =
-- print " [THUNK_SELECTOR] &&thunk_lbl,"
-- print " [IND] &&ind_lbl,"
-- print " [IND_STATIC] &&ind_lbl,"
-- print " [IND_PERM] &&ind_lbl,"
-- print " };"
tickForArity (length args),
......@@ -750,8 +749,7 @@ genApply regstatus args =
-- print " ind_lbl:"
-- else:
text "case IND,",
text " IND_STATIC,",
text " IND_PERM: {",
text " IND_STATIC: {",
nest 4 (vcat [
text "R1 = StgInd_indirectee(R1);",
-- An indirection node might contain a tagged pointer
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment