diff options
author | Simon Marlow <marlowsd@gmail.com> | 2016-11-09 09:20:02 +0000 |
---|---|---|
committer | Simon Marlow <marlowsd@gmail.com> | 2016-11-14 14:43:35 +0000 |
commit | 55d535da10dd63bbaf03fb176ced7179087cd0d4 (patch) | |
tree | 57bdbf04381fe08d90c384f5b10e77c3384227d9 /rts/sm | |
parent | 6c0f10fac767c49b65ed71e8eb8e78ca4f9062d5 (diff) | |
download | haskell-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/sm')
-rw-r--r-- | rts/sm/CNF.c | 12 | ||||
-rw-r--r-- | rts/sm/Compact.c | 9 | ||||
-rw-r--r-- | rts/sm/Evac.c | 13 | ||||
-rw-r--r-- | rts/sm/GCAux.c | 2 | ||||
-rw-r--r-- | rts/sm/Sanity.c | 22 | ||||
-rw-r--r-- | rts/sm/Scav.c | 11 |
6 files changed, 38 insertions, 31 deletions
diff --git a/rts/sm/CNF.c b/rts/sm/CNF.c index f8e706aaf4..5fa148d426 100644 --- a/rts/sm/CNF.c +++ b/rts/sm/CNF.c @@ -621,8 +621,7 @@ simple_scavenge_block (Capability *cap, case CONSTR: case PRIM: - case CONSTR_NOCAF_STATIC: - case CONSTR_STATIC: + case CONSTR_NOCAF: { StgPtr end; @@ -705,8 +704,7 @@ objectIsWHNFData (StgClosure *what) case CONSTR_2_0: case CONSTR_1_1: case CONSTR_0_2: - case CONSTR_STATIC: - case CONSTR_NOCAF_STATIC: + case CONSTR_NOCAF: case ARR_WORDS: case MUT_ARR_PTRS_FROZEN: case MUT_ARR_PTRS_FROZEN0: @@ -776,8 +774,7 @@ verify_consistency_block (StgCompactNFData *str, StgCompactNFDataBlock *block) case CONSTR: case PRIM: - case CONSTR_STATIC: - case CONSTR_NOCAF_STATIC: + case CONSTR_NOCAF: { uint32_t i; @@ -1108,8 +1105,7 @@ fixup_block(StgCompactNFDataBlock *block, StgWord *fixup_table, uint32_t count) case CONSTR: case PRIM: - case CONSTR_STATIC: - case CONSTR_NOCAF_STATIC: + case CONSTR_NOCAF: { StgPtr end; diff --git a/rts/sm/Compact.c b/rts/sm/Compact.c index 3528fabb7b..1f7f08748a 100644 --- a/rts/sm/Compact.c +++ b/rts/sm/Compact.c @@ -214,7 +214,13 @@ thread_static( StgClosure* p ) case FUN_STATIC: p = *FUN_STATIC_LINK(p); continue; - case CONSTR_STATIC: + case CONSTR: + case CONSTR_NOCAF: + case CONSTR_1_0: + case CONSTR_0_1: + case CONSTR_2_0: + case CONSTR_1_1: + case CONSTR_0_2: p = *STATIC_LINK(info,p); continue; @@ -609,6 +615,7 @@ thread_obj (const StgInfoTable *info, StgPtr p) case FUN: case CONSTR: + case CONSTR_NOCAF: case PRIM: case MUT_PRIM: case MUT_VAR_CLEAN: diff --git a/rts/sm/Evac.c b/rts/sm/Evac.c index 1f9c5cc8cd..1323cbea6a 100644 --- a/rts/sm/Evac.c +++ b/rts/sm/Evac.c @@ -548,11 +548,16 @@ loop: evacuate_static_object(IND_STATIC_LINK((StgClosure *)q), q); return; - case CONSTR_STATIC: + case CONSTR: + case CONSTR_1_0: + case CONSTR_2_0: + case CONSTR_1_1: evacuate_static_object(STATIC_LINK(info,(StgClosure *)q), q); return; - case CONSTR_NOCAF_STATIC: + case CONSTR_0_1: + case CONSTR_0_2: + case CONSTR_NOCAF: /* no need to put these on the static linked list, they don't need * to be scavenged. */ @@ -716,6 +721,7 @@ loop: case FUN: case CONSTR: + case CONSTR_NOCAF: copy_tag_nolock(p,info,q,sizeW_fromITBL(INFO_PTR_TO_STRUCT(info)),gen_no,tag); return; @@ -1048,8 +1054,7 @@ selector_loop: case CONSTR_2_0: case CONSTR_1_1: case CONSTR_0_2: - case CONSTR_STATIC: - case CONSTR_NOCAF_STATIC: + case CONSTR_NOCAF: { // check that the size is in range ASSERT(field < (StgWord32)(info->layout.payload.ptrs + diff --git a/rts/sm/GCAux.c b/rts/sm/GCAux.c index 6265bf9ca1..23ed3f0622 100644 --- a/rts/sm/GCAux.c +++ b/rts/sm/GCAux.c @@ -51,7 +51,7 @@ isAlive(StgClosure *p) // // ToDo: for static closures, check the static link field. // Problem here is that we sometimes don't set the link field, eg. - // for static closures with an empty SRT or CONSTR_STATIC_NOCAFs. + // for static closures with an empty SRT or CONSTR_NOCAFs. // if (!HEAP_ALLOCED_GC(q)) { return p; diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c index f1b57eae66..413aee945b 100644 --- a/rts/sm/Sanity.c +++ b/rts/sm/Sanity.c @@ -86,13 +86,6 @@ checkClosureShallow( const StgClosure* p ) q = UNTAG_CONST_CLOSURE(p); ASSERT(LOOKS_LIKE_CLOSURE_PTR(q)); - - /* Is it a static closure? */ - if (!HEAP_ALLOCED(q)) { - ASSERT(closure_STATIC(q)); - } else { - ASSERT(!closure_STATIC(q)); - } } // check an individual stack object @@ -225,12 +218,6 @@ checkClosure( const StgClosure* p ) ASSERT(LOOKS_LIKE_CLOSURE_PTR(p)); p = UNTAG_CONST_CLOSURE(p); - /* Is it a static closure (i.e. in the data segment)? */ - if (!HEAP_ALLOCED(p)) { - ASSERT(closure_STATIC(p)); - } else { - ASSERT(!closure_STATIC(p)); - } info = p->header.info; @@ -272,6 +259,7 @@ checkClosure( const StgClosure* p ) case FUN_0_2: case FUN_2_0: case CONSTR: + case CONSTR_NOCAF: case CONSTR_1_0: case CONSTR_0_1: case CONSTR_1_1: @@ -283,8 +271,6 @@ checkClosure( const StgClosure* p ) case MUT_VAR_CLEAN: case MUT_VAR_DIRTY: case TVAR: - case CONSTR_STATIC: - case CONSTR_NOCAF_STATIC: case THUNK_STATIC: case FUN_STATIC: { @@ -692,7 +678,11 @@ checkStaticObjects ( StgClosure* static_objects ) p = *FUN_STATIC_LINK((StgClosure *)p); break; - case CONSTR_STATIC: + case CONSTR: + case CONSTR_NOCAF: + case CONSTR_1_0: + case CONSTR_2_0: + case CONSTR_1_1: p = *STATIC_LINK(info,(StgClosure *)p); break; diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c index 1549df5021..595d8275cf 100644 --- a/rts/sm/Scav.c +++ b/rts/sm/Scav.c @@ -560,6 +560,7 @@ scavenge_block (bdescr *bd) gen_obj: case CONSTR: + case CONSTR_NOCAF: case WEAK: case PRIM: { @@ -968,6 +969,7 @@ scavenge_mark_stack(void) gen_obj: case CONSTR: + case CONSTR_NOCAF: case WEAK: case PRIM: { @@ -1290,6 +1292,7 @@ scavenge_one(StgPtr p) case FUN_0_2: case FUN_2_0: case CONSTR: + case CONSTR_NOCAF: case CONSTR_1_0: case CONSTR_0_1: case CONSTR_1_1: @@ -1754,7 +1757,13 @@ scavenge_static(void) scavenge_fun_srt(info); break; - case CONSTR_STATIC: + case CONSTR: + case CONSTR_NOCAF: + case CONSTR_1_0: + case CONSTR_0_1: + case CONSTR_2_0: + case CONSTR_1_1: + case CONSTR_0_2: { StgPtr q, next; |