diff options
author | Simon Marlow <simonmarhaskell@gmail.com> | 2008-04-17 21:27:07 +0000 |
---|---|---|
committer | Simon Marlow <simonmarhaskell@gmail.com> | 2008-04-17 21:27:07 +0000 |
commit | 4e79709df545c16812b85f2c27ab3411f5a7b54f (patch) | |
tree | 518c23ecad5b34b5ad99d5ecd7b2fb2c52949c4f /rts/sm/MarkWeak.c | |
parent | a4e09e8f27b81e915b128ef244c7b0d082bfb89a (diff) | |
download | haskell-4e79709df545c16812b85f2c27ab3411f5a7b54f.tar.gz |
remove EVACUATED: store the forwarding pointer in the info pointer
Diffstat (limited to 'rts/sm/MarkWeak.c')
-rw-r--r-- | rts/sm/MarkWeak.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/rts/sm/MarkWeak.c b/rts/sm/MarkWeak.c index 5f71a30627..96b4f674f3 100644 --- a/rts/sm/MarkWeak.c +++ b/rts/sm/MarkWeak.c @@ -96,6 +96,7 @@ traverseWeakPtrList(void) StgWeak *w, **last_w, *next_w; StgClosure *new; rtsBool flag = rtsFalse; + const StgInfoTable *info; switch (weak_stage) { @@ -120,12 +121,14 @@ traverseWeakPtrList(void) continue; } - switch (get_itbl(w)->type) { - - case EVACUATED: - next_w = (StgWeak *)((StgEvacuated *)w)->evacuee; + info = w->header.info; + if (IS_FORWARDING_PTR(info)) { + next_w = (StgWeak *)UN_FORWARDING_PTR(info); *last_w = next_w; continue; + } + + switch (INFO_PTR_TO_STRUCT(info)->type) { case WEAK: /* Now, check whether the key is reachable. @@ -367,8 +370,9 @@ markWeakPtrList ( void ) last_w = &weak_ptr_list; for (w = weak_ptr_list; w; w = w->link) { // w might be WEAK, EVACUATED, or DEAD_WEAK (actually CON_STATIC) here - ASSERT(w->header.info == &stg_DEAD_WEAK_info - || get_itbl(w)->type == WEAK || get_itbl(w)->type == EVACUATED); + ASSERT(IS_FORWARDING_PTR(w->header.info) + || w->header.info == &stg_DEAD_WEAK_info + || get_itbl(w)->type == WEAK); tmp = w; evacuate((StgClosure **)&tmp); *last_w = w; |