From a0be7e7ccd602efd9b7d35b3e0747a2c4f155ce9 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Thu, 7 Sep 2006 09:30:05 +0000 Subject: [PATCH] Remove CONSTR_CHARLIKE and CONSTR_INTLIKE closure types These closure types aren't used/needed, as far as I can tell. The commoning up of Chars/Ints happens by comparing info pointers, and the info table for a dynamic C#/I# is CONSTR_0_1. The RTS seemed a little confused about whether CONSTR_CHARLIKE/CONSTR_INTLIKE were supposed to be static or dynamic closures, too. --- includes/ClosureTypes.h | 132 +++++++++++++++++++++++------------------------ rts/ClosureFlags.c | 5 +- rts/GC.c | 2 - rts/Interpreter.c | 2 - rts/LdvProfile.c | 2 - rts/Printer.c | 4 -- rts/ProfHeap.c | 4 -- rts/RetainerProfile.c | 16 +----- rts/Sanity.c | 2 - 9 files changed, 67 insertions(+), 102 deletions(-) diff --git a/includes/ClosureTypes.h b/includes/ClosureTypes.h index f884026..ae2aab3 100644 --- a/includes/ClosureTypes.h +++ b/includes/ClosureTypes.h @@ -28,72 +28,70 @@ #define CONSTR_2_0 4 #define CONSTR_1_1 5 #define CONSTR_0_2 6 -#define CONSTR_INTLIKE 7 -#define CONSTR_CHARLIKE 8 -#define CONSTR_STATIC 9 -#define CONSTR_NOCAF_STATIC 10 -#define FUN 11 -#define FUN_1_0 12 -#define FUN_0_1 13 -#define FUN_2_0 14 -#define FUN_1_1 15 -#define FUN_0_2 16 -#define FUN_STATIC 17 -#define THUNK 18 -#define THUNK_1_0 19 -#define THUNK_0_1 20 -#define THUNK_2_0 21 -#define THUNK_1_1 22 -#define THUNK_0_2 23 -#define THUNK_STATIC 24 -#define THUNK_SELECTOR 25 -#define BCO 26 -#define AP 27 -#define PAP 28 -#define AP_STACK 29 -#define IND 30 -#define IND_OLDGEN 31 -#define IND_PERM 32 -#define IND_OLDGEN_PERM 33 -#define IND_STATIC 34 -#define RET_BCO 35 -#define RET_SMALL 36 -#define RET_VEC_SMALL 37 -#define RET_BIG 38 -#define RET_VEC_BIG 39 -#define RET_DYN 40 -#define RET_FUN 41 -#define UPDATE_FRAME 42 -#define CATCH_FRAME 43 -#define STOP_FRAME 44 -#define CAF_BLACKHOLE 45 -#define BLACKHOLE 46 -#define SE_BLACKHOLE 47 -#define SE_CAF_BLACKHOLE 48 -#define MVAR 49 -#define ARR_WORDS 50 -#define MUT_ARR_PTRS_CLEAN 51 -#define MUT_ARR_PTRS_DIRTY 52 -#define MUT_ARR_PTRS_FROZEN0 53 -#define MUT_ARR_PTRS_FROZEN 54 -#define MUT_VAR_CLEAN 55 -#define MUT_VAR_DIRTY 56 -#define WEAK 57 -#define STABLE_NAME 58 -#define TSO 59 -#define BLOCKED_FETCH 60 -#define FETCH_ME 61 -#define FETCH_ME_BQ 62 -#define RBH 63 -#define EVACUATED 64 -#define REMOTE_REF 65 -#define TVAR_WAIT_QUEUE 66 -#define TVAR 67 -#define TREC_CHUNK 68 -#define TREC_HEADER 69 -#define ATOMICALLY_FRAME 70 -#define CATCH_RETRY_FRAME 71 -#define CATCH_STM_FRAME 72 -#define N_CLOSURE_TYPES 73 +#define CONSTR_STATIC 7 +#define CONSTR_NOCAF_STATIC 8 +#define FUN 9 +#define FUN_1_0 10 +#define FUN_0_1 11 +#define FUN_2_0 12 +#define FUN_1_1 13 +#define FUN_0_2 14 +#define FUN_STATIC 15 +#define THUNK 16 +#define THUNK_1_0 17 +#define THUNK_0_1 18 +#define THUNK_2_0 19 +#define THUNK_1_1 20 +#define THUNK_0_2 21 +#define THUNK_STATIC 22 +#define THUNK_SELECTOR 23 +#define BCO 24 +#define AP 25 +#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_VEC_SMALL 35 +#define RET_BIG 36 +#define RET_VEC_BIG 37 +#define RET_DYN 38 +#define RET_FUN 39 +#define UPDATE_FRAME 40 +#define CATCH_FRAME 41 +#define STOP_FRAME 42 +#define CAF_BLACKHOLE 43 +#define BLACKHOLE 44 +#define SE_BLACKHOLE 45 +#define SE_CAF_BLACKHOLE 46 +#define MVAR 47 +#define ARR_WORDS 48 +#define MUT_ARR_PTRS_CLEAN 49 +#define MUT_ARR_PTRS_DIRTY 50 +#define MUT_ARR_PTRS_FROZEN0 51 +#define MUT_ARR_PTRS_FROZEN 52 +#define MUT_VAR_CLEAN 53 +#define MUT_VAR_DIRTY 54 +#define WEAK 55 +#define STABLE_NAME 56 +#define TSO 57 +#define BLOCKED_FETCH 58 +#define FETCH_ME 59 +#define FETCH_ME_BQ 60 +#define RBH 61 +#define EVACUATED 62 +#define REMOTE_REF 63 +#define TVAR_WAIT_QUEUE 64 +#define TVAR 65 +#define TREC_CHUNK 66 +#define TREC_HEADER 67 +#define ATOMICALLY_FRAME 68 +#define CATCH_RETRY_FRAME 69 +#define CATCH_STM_FRAME 70 +#define N_CLOSURE_TYPES 71 #endif /* CLOSURETYPES_H */ diff --git a/rts/ClosureFlags.c b/rts/ClosureFlags.c index 5545693..260bf39 100644 --- a/rts/ClosureFlags.c +++ b/rts/ClosureFlags.c @@ -33,8 +33,6 @@ StgWord16 closure_flags[] = { /* CONSTR_2_0 = */ (_HNF| _NS ), /* CONSTR_1_1 = */ (_HNF| _NS ), /* CONSTR_0_2 = */ (_HNF| _NS ), -/* CONSTR_INTLIKE = */ (_HNF| _NS|_STA ), -/* CONSTR_CHARLIKE = */ (_HNF| _NS|_STA ), /* CONSTR_STATIC = */ (_HNF| _NS|_STA ), /* CONSTR_NOCAF_STATIC = */ (_HNF| _NS|_STA ), /* FUN = */ (_HNF| _NS| _SRT ), @@ -101,7 +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/GC.c b/rts/GC.c index 967f48d..66bb5dc 100644 --- a/rts/GC.c +++ b/rts/GC.c @@ -1898,8 +1898,6 @@ loop: } return q; - case CONSTR_INTLIKE: - case CONSTR_CHARLIKE: case CONSTR_NOCAF_STATIC: /* no need to put these on the static linked list, they don't need * to be scavenged. diff --git a/rts/Interpreter.c b/rts/Interpreter.c index 56e9bb6..81d4e38 100644 --- a/rts/Interpreter.c +++ b/rts/Interpreter.c @@ -261,8 +261,6 @@ eval_obj: case CONSTR_2_0: case CONSTR_1_1: case CONSTR_0_2: - case CONSTR_INTLIKE: - case CONSTR_CHARLIKE: case CONSTR_STATIC: case CONSTR_NOCAF_STATIC: case FUN: diff --git a/rts/LdvProfile.c b/rts/LdvProfile.c index 19ebe42..5d96811 100644 --- a/rts/LdvProfile.c +++ b/rts/LdvProfile.c @@ -168,8 +168,6 @@ processHeapClosureForDead( StgClosure *c ) case CONSTR_STATIC: case FUN_STATIC: case THUNK_STATIC: - case CONSTR_INTLIKE: - case CONSTR_CHARLIKE: case CONSTR_NOCAF_STATIC: // stack objects case UPDATE_FRAME: diff --git a/rts/Printer.c b/rts/Printer.c index 36fdf7b..83afd48 100644 --- a/rts/Printer.c +++ b/rts/Printer.c @@ -133,8 +133,6 @@ printClosure( StgClosure *obj ) case CONSTR: case CONSTR_1_0: case CONSTR_0_1: case CONSTR_1_1: case CONSTR_0_2: case CONSTR_2_0: - case CONSTR_INTLIKE: - case CONSTR_CHARLIKE: case CONSTR_STATIC: case CONSTR_NOCAF_STATIC: { @@ -657,8 +655,6 @@ static char *closure_type_names[] = { "CONSTR_2", "CONSTR_1", "CONSTR_0", - "CONSTR_INTLIKE", - "CONSTR_CHARLIKE", "CONSTR_STATIC", "CONSTR_NOCAF_STATIC", "FUN", diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c index 312bee7..8f4c8ba 100644 --- a/rts/ProfHeap.c +++ b/rts/ProfHeap.c @@ -114,8 +114,6 @@ static void dumpCensus( Census *census ); static char *type_names[] = { "INVALID_OBJECT" , "CONSTR" - , "CONSTR_INTLIKE" - , "CONSTR_CHARLIKE" , "CONSTR_STATIC" , "CONSTR_NOCAF_STATIC" @@ -905,8 +903,6 @@ heapCensusChain( Census *census, bdescr *bd ) case SE_CAF_BLACKHOLE: case SE_BLACKHOLE: case BLACKHOLE: - case CONSTR_INTLIKE: - case CONSTR_CHARLIKE: case FUN_1_0: case FUN_0_1: case FUN_1_1: diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c index c5c3de5..a18a194 100644 --- a/rts/RetainerProfile.c +++ b/rts/RetainerProfile.c @@ -612,8 +612,6 @@ push( StgClosure *c, retainer c_child_r, StgClosure **first_child ) case AP_STACK: case TSO: case IND_STATIC: - case CONSTR_INTLIKE: - case CONSTR_CHARLIKE: case CONSTR_NOCAF_STATIC: // stack objects case UPDATE_FRAME: @@ -974,8 +972,6 @@ pop( StgClosure **c, StgClosure **cp, retainer *r ) case AP_STACK: case TSO: case IND_STATIC: - case CONSTR_INTLIKE: - case CONSTR_CHARLIKE: case CONSTR_NOCAF_STATIC: // stack objects case RET_DYN: @@ -1139,10 +1135,8 @@ isRetainer( StgClosure *c ) // // IND_STATIC cannot be *c, *cp, *r in the retainer profiling loop. case IND_STATIC: - // CONSTR_INTLIKE, CONSTR_CHARLIKE, and CONSTR_NOCAF_STATIC + // CONSTR_NOCAF_STATIC // cannot be *c, *cp, *r in the retainer profiling loop. - case CONSTR_INTLIKE: - case CONSTR_CHARLIKE: case CONSTR_NOCAF_STATIC: // Stack objects are invalid because they are never treated as // legal objects during retainer profiling. @@ -1609,8 +1603,6 @@ inner_loop: #ifdef DEBUG_RETAINER switch (typeOfc) { case IND_STATIC: - case CONSTR_INTLIKE: - case CONSTR_CHARLIKE: case CONSTR_NOCAF_STATIC: case CONSTR_STATIC: case THUNK_STATIC: @@ -1648,8 +1640,6 @@ inner_loop: // We just skip IND_STATIC, so its retainer set is never computed. c = ((StgIndStatic *)c)->indirectee; goto inner_loop; - case CONSTR_INTLIKE: - case CONSTR_CHARLIKE: // static objects with no pointers out, so goto loop. case CONSTR_NOCAF_STATIC: // It is not just enough not to compute the retainer set for *c; it is @@ -1880,8 +1870,6 @@ computeRetainerSet( void ) case IND_STATIC: // no cost involved break; - case CONSTR_INTLIKE: - case CONSTR_CHARLIKE: case CONSTR_NOCAF_STATIC: case CONSTR_STATIC: case THUNK_STATIC: @@ -2012,8 +2000,6 @@ retainerProfile(void) pcostArrayLinear(FUN_STATIC); pcostArrayLinear(CONSTR_STATIC); pcostArrayLinear(CONSTR_NOCAF_STATIC); - pcostArrayLinear(CONSTR_INTLIKE); - pcostArrayLinear(CONSTR_CHARLIKE); */ #endif diff --git a/rts/Sanity.c b/rts/Sanity.c index 0e68a86..33ec988 100644 --- a/rts/Sanity.c +++ b/rts/Sanity.c @@ -307,8 +307,6 @@ checkClosure( StgClosure* p ) case STABLE_NAME: case MUT_VAR_CLEAN: case MUT_VAR_DIRTY: - case CONSTR_INTLIKE: - case CONSTR_CHARLIKE: case CONSTR_STATIC: case CONSTR_NOCAF_STATIC: case THUNK_STATIC: -- 1.7.10.4