diff options
author | Ben Gamari <ben@well-typed.com> | 2019-02-05 11:01:10 -0500 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2019-10-18 15:26:53 -0400 |
commit | 206f782a69ce8b0be7a39570abc09dfdf1514f18 (patch) | |
tree | 094918b93911e806edb39eff3e5537c1c71d1a7d /rts | |
parent | 113950379c2d945397d30f89f4fda0080eac112b (diff) | |
download | haskell-206f782a69ce8b0be7a39570abc09dfdf1514f18.tar.gz |
rts: Give stack flags proper macros
This were previously quite unclear and will change a bit under the
non-moving collector so let's clear this up now.
Diffstat (limited to 'rts')
-rw-r--r-- | rts/PrimOps.cmm | 4 | ||||
-rw-r--r-- | rts/Threads.c | 4 | ||||
-rw-r--r-- | rts/sm/Sanity.c | 8 | ||||
-rw-r--r-- | rts/sm/Storage.c | 4 |
4 files changed, 10 insertions, 10 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index d06cde05d9..a2ab3de586 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -1744,7 +1744,7 @@ loop: // indicate that the MVar operation has now completed. StgTSO__link(tso) = stg_END_TSO_QUEUE_closure; - if (TO_W_(StgStack_dirty(stack)) == 0) { + if ((TO_W_(StgStack_dirty(stack)) & STACK_DIRTY) == 0) { ccall dirty_STACK(MyCapability() "ptr", stack "ptr"); } @@ -1829,7 +1829,7 @@ loop: // indicate that the MVar operation has now completed. StgTSO__link(tso) = stg_END_TSO_QUEUE_closure; - if (TO_W_(StgStack_dirty(stack)) == 0) { + if ((TO_W_(StgStack_dirty(stack)) & STACK_DIRTY) == 0) { ccall dirty_STACK(MyCapability() "ptr", stack "ptr"); } diff --git a/rts/Threads.c b/rts/Threads.c index 2bdcea1c00..3d5b463051 100644 --- a/rts/Threads.c +++ b/rts/Threads.c @@ -85,7 +85,7 @@ createThread(Capability *cap, W_ size) SET_HDR(stack, &stg_STACK_info, cap->r.rCCCS); stack->stack_size = stack_size - sizeofW(StgStack); stack->sp = stack->stack + stack->stack_size; - stack->dirty = 1; + stack->dirty = STACK_DIRTY; tso = (StgTSO *)allocate(cap, sizeofW(StgTSO)); TICK_ALLOC_TSO(); @@ -804,7 +804,7 @@ loop: // indicate that the MVar operation has now completed. tso->_link = (StgTSO*)&stg_END_TSO_QUEUE_closure; - if (stack->dirty == 0) { + if ((stack->dirty & STACK_DIRTY) == 0) { dirty_STACK(cap, stack); } diff --git a/rts/sm/Sanity.c b/rts/sm/Sanity.c index 3585bd93b4..289ac542b8 100644 --- a/rts/sm/Sanity.c +++ b/rts/sm/Sanity.c @@ -632,9 +632,9 @@ checkGlobalTSOList (bool checkTSOs) stack = tso->stackobj; while (1) { - if (stack->dirty & 1) { - ASSERT(Bdescr((P_)stack)->gen_no == 0 || (stack->dirty & TSO_MARKED)); - stack->dirty &= ~TSO_MARKED; + if (stack->dirty & STACK_DIRTY) { + ASSERT(Bdescr((P_)stack)->gen_no == 0 || (stack->dirty & STACK_SANE)); + stack->dirty &= ~STACK_SANE; } frame = (StgUnderflowFrame*) (stack->stack + stack->stack_size - sizeofW(StgUnderflowFrame)); @@ -669,7 +669,7 @@ checkMutableList( bdescr *mut_bd, uint32_t gen ) ((StgTSO *)p)->flags |= TSO_MARKED; break; case STACK: - ((StgStack *)p)->dirty |= TSO_MARKED; + ((StgStack *)p)->dirty |= STACK_SANE; break; } } diff --git a/rts/sm/Storage.c b/rts/sm/Storage.c index 0130a08f7c..97c71478ed 100644 --- a/rts/sm/Storage.c +++ b/rts/sm/Storage.c @@ -1139,8 +1139,8 @@ dirty_TSO (Capability *cap, StgTSO *tso) void dirty_STACK (Capability *cap, StgStack *stack) { - if (stack->dirty == 0) { - stack->dirty = 1; + if (! (stack->dirty & STACK_DIRTY)) { + stack->dirty = STACK_DIRTY; recordClosureMutated(cap,(StgClosure*)stack); } } |