summaryrefslogtreecommitdiff
path: root/rts
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2021-09-30 15:52:59 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-10-02 05:19:51 -0400
commit040c347e3cc968d37e76bca228f1f5df997d3672 (patch)
treeead543ab1041b2ccc9049917d0aa8ec8cb54815a /rts
parent4264e74d61d53e04d8109127cd52028a72a37eb2 (diff)
downloadhaskell-040c347e3cc968d37e76bca228f1f5df997d3672.tar.gz
rts: Unify stack dirtiness check
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.
Diffstat (limited to 'rts')
-rw-r--r--rts/PrimOps.cmm6
-rw-r--r--rts/include/Cmm.h6
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