summaryrefslogtreecommitdiff
path: root/rts/RetainerProfile.c
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2016-11-09 09:20:02 +0000
committerSimon Marlow <marlowsd@gmail.com>2016-11-14 14:43:35 +0000
commit55d535da10dd63bbaf03fb176ced7179087cd0d4 (patch)
tree57bdbf04381fe08d90c384f5b10e77c3384227d9 /rts/RetainerProfile.c
parent6c0f10fac767c49b65ed71e8eb8e78ca4f9062d5 (diff)
downloadhaskell-55d535da10dd63bbaf03fb176ced7179087cd0d4.tar.gz
Remove CONSTR_STATIC
Summary: We currently have two info tables for a constructor * XXX_con_info: the info table for a heap-resident instance of the constructor, It has type CONSTR, or one of the specialised types like CONSTR_1_0 * XXX_static_info: the info table for a static instance of this constructor, which has type CONSTR_STATIC or CONSTR_STATIC_NOCAF. I'm getting rid of the latter, and using the `con_info` info table for both static and dynamic constructors. For rationale and more details see Note [static constructors] in SMRep.hs. I also removed these macros: `isSTATIC()`, `ip_STATIC()`, `closure_STATIC()`, since they relied on the CONSTR/CONSTR_STATIC distinction, and anyway HEAP_ALLOCED() does the same job. Test Plan: validate Reviewers: bgamari, simonpj, austin, gcampax, hvr, niteria, erikd Subscribers: thomie Differential Revision: https://phabricator.haskell.org/D2690 GHC Trac Issues: #12455
Diffstat (limited to 'rts/RetainerProfile.c')
-rw-r--r--rts/RetainerProfile.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/rts/RetainerProfile.c b/rts/RetainerProfile.c
index 6cd9c89b83..b9545387f5 100644
--- a/rts/RetainerProfile.c
+++ b/rts/RetainerProfile.c
@@ -504,10 +504,10 @@ push( StgClosure *c, retainer c_child_r, StgClosure **first_child )
// layout.payload.ptrs, no SRT
case TVAR:
case CONSTR:
+ case CONSTR_NOCAF:
case PRIM:
case MUT_PRIM:
case BCO:
- case CONSTR_STATIC:
init_ptrs(&se.info, get_itbl(c)->layout.payload.ptrs,
(StgPtr)c->payload);
*first_child = find_ptrs(&se.info);
@@ -609,7 +609,6 @@ push( StgClosure *c, retainer c_child_r, StgClosure **first_child )
case TSO:
case STACK:
case IND_STATIC:
- case CONSTR_NOCAF_STATIC:
// stack objects
case UPDATE_FRAME:
case CATCH_FRAME:
@@ -859,7 +858,6 @@ pop( StgClosure **c, StgClosure **cp, retainer *r )
case PRIM:
case MUT_PRIM:
case BCO:
- case CONSTR_STATIC:
// StgMutArrPtr.ptrs, no SRT
case MUT_ARR_PTRS_CLEAN:
case MUT_ARR_PTRS_DIRTY:
@@ -938,7 +936,7 @@ pop( StgClosure **c, StgClosure **cp, retainer *r )
case TSO:
case STACK:
case IND_STATIC:
- case CONSTR_NOCAF_STATIC:
+ case CONSTR_NOCAF:
// stack objects
case UPDATE_FRAME:
case CATCH_FRAME:
@@ -1050,6 +1048,7 @@ isRetainer( StgClosure *c )
// constructors
case CONSTR:
+ case CONSTR_NOCAF:
case CONSTR_1_0:
case CONSTR_0_1:
case CONSTR_2_0:
@@ -1071,7 +1070,6 @@ isRetainer( StgClosure *c )
case IND_STATIC:
case BLACKHOLE:
// static objects
- case CONSTR_STATIC:
case FUN_STATIC:
// misc
case PRIM:
@@ -1087,9 +1085,6 @@ isRetainer( StgClosure *c )
//
// Error case
//
- // CONSTR_NOCAF_STATIC
- // cannot be *c, *cp, *r in the retainer profiling loop.
- case CONSTR_NOCAF_STATIC:
// Stack objects are invalid because they are never treated as
// legal objects during retainer profiling.
case UPDATE_FRAME:
@@ -1527,8 +1522,7 @@ inner_loop:
#ifdef DEBUG_RETAINER
switch (typeOfc) {
case IND_STATIC:
- case CONSTR_NOCAF_STATIC:
- case CONSTR_STATIC:
+ case CONSTR_NOCAF:
case THUNK_STATIC:
case FUN_STATIC:
break;
@@ -1558,9 +1552,9 @@ inner_loop:
c = ((StgIndStatic *)c)->indirectee;
goto inner_loop;
// static objects with no pointers out, so goto loop.
- case CONSTR_NOCAF_STATIC:
+ case CONSTR_NOCAF:
// It is not just enough not to compute the retainer set for *c; it is
- // mandatory because CONSTR_NOCAF_STATIC are not reachable from
+ // mandatory because CONSTR_NOCAF are not reachable from
// scavenged_static_objects, the list from which is assumed to traverse
// all static objects after major garbage collections.
goto loop;
@@ -1585,7 +1579,7 @@ inner_loop:
// "appear". A closure with a non-empty SRT, and which is
// still required, will always be reachable.
//
- // But what about CONSTR_STATIC? Surely these may be able
+ // But what about CONSTR? Surely these may be able
// to appear, and they don't have SRTs, so we can't
// check. So for now, we're calling
// resetStaticObjectForRetainerProfiling() from the
@@ -1819,8 +1813,7 @@ computeRetainerSet( void )
case IND_STATIC:
// no cost involved
break;
- case CONSTR_NOCAF_STATIC:
- case CONSTR_STATIC:
+ case CONSTR_NOCAF:
case THUNK_STATIC:
case FUN_STATIC:
barf("Invalid object in computeRetainerSet(): %d", get_itbl((StgClosure*)ml)->type);
@@ -1896,7 +1889,11 @@ resetStaticObjectForRetainerProfiling( StgClosure *static_objects )
maybeInitRetainerSet(p);
p = (StgClosure*)*FUN_STATIC_LINK(p);
break;
- case CONSTR_STATIC:
+ case CONSTR:
+ case CONSTR_1_0:
+ case CONSTR_2_0:
+ case CONSTR_1_1:
+ case CONSTR_NOCAF:
maybeInitRetainerSet(p);
p = (StgClosure*)*STATIC_LINK(get_itbl(p), p);
break;
@@ -1958,8 +1955,7 @@ retainerProfile(void)
debugBelch("costArrayLinear[" #index "] = %u\n", costArrayLinear[index])
pcostArrayLinear(THUNK_STATIC);
pcostArrayLinear(FUN_STATIC);
- pcostArrayLinear(CONSTR_STATIC);
- pcostArrayLinear(CONSTR_NOCAF_STATIC);
+ pcostArrayLinear(CONSTR_NOCAF);
*/
#endif
@@ -2067,7 +2063,6 @@ static uint32_t
sanityCheckHeapClosure( StgClosure *c )
{
ASSERT(LOOKS_LIKE_GHC_INFO(c->header.info));
- ASSERT(!closure_STATIC(c));
ASSERT(LOOKS_LIKE_PTR(c));
if ((((StgWord)RSET(c) & 1) ^ flip) != 0) {