diff options
author | Ben Gamari <ben@smart-cactus.org> | 2021-09-30 15:52:59 +0000 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2021-09-30 22:56:43 +0000 |
commit | 23f11efb9a59f99a1d4c7e4cd1955259fcaeb549 (patch) | |
tree | 346e343142fbf4504b9dc360b0d88d1e34fa6a31 | |
parent | 801978bdfbe635a76e474ea32fd3da83b59325d1 (diff) | |
download | haskell-wip/T20399.tar.gz |
rts: Unify stack dirtiness checkwip/T20399
This fixes an inconsistency where one dirtiness check would not mask out
the STACK_DIRTY flag, meaning it may also be affected by the STACK_SANE
flag.
-rw-r--r-- | rts/PrimOps.cmm | 6 | ||||
-rw-r--r-- | rts/include/Cmm.h | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 26c4cfe7b4..2211dce391 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -1924,7 +1924,7 @@ loop: // actually perform the takeMVar W_ stack; stack = StgTSO_stackobj(tso); - if ((TO_W_(StgStack_dirty(stack)) & STACK_DIRTY) == 0) { + if (IS_STACK_CLEAN(stack)) { ccall dirty_STACK(MyCapability() "ptr", stack "ptr"); } PerformTake(stack, val); @@ -2014,7 +2014,7 @@ loop: // actually perform the takeMVar W_ stack; stack = StgTSO_stackobj(tso); - if ((TO_W_(StgStack_dirty(stack)) & STACK_DIRTY) == 0) { + if (IS_STACK_CLEAN(stack)) { ccall dirty_STACK(MyCapability() "ptr", stack "ptr"); } PerformTake(stack, val); @@ -2295,7 +2295,7 @@ loop: // actually perform the takeMVar W_ stack; stack = StgTSO_stackobj(tso); - if (TO_W_(StgStack_dirty(stack)) == 0) { + if (IS_STACK_CLEAN(stack)) { ccall dirty_STACK(MyCapability() "ptr", stack "ptr"); } PerformTake(stack, val); diff --git a/rts/include/Cmm.h b/rts/include/Cmm.h index 94951bc9f8..55d201d94d 100644 --- a/rts/include/Cmm.h +++ b/rts/include/Cmm.h @@ -643,6 +643,9 @@ if (TO_W_(RtsFlags_ProfFlags_doHeapProfile(RtsFlags)) != 0) { foreign "C" overwritingMutableClosureOfs(c "ptr", off); } #endif +#define IS_STACK_CLEAN(stack) \ + ((TO_W_(StgStack_dirty(stack)) & STACK_DIRTY) == 0) + // Memory barriers. // For discussion of how these are used to fence heap object // accesses see Note [Heap memory barriers] in SMP.h. @@ -787,9 +790,6 @@ __gen = TO_W_(bdescr_gen_no(__bd)); \ if (__gen > 0) { recordMutableCap(__p, __gen); } -/* ----------------------------------------------------------------------------- - Update remembered set write barrier - -------------------------------------------------------------------------- */ /* ----------------------------------------------------------------------------- Arrays |