summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGHC GitLab CI <ghc-ci@gitlab-haskell.org>2021-06-11 00:41:19 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2021-06-26 22:42:03 -0400
commit221a104f44fdf58e4514d41ae827747c2bf938c8 (patch)
tree193d8b0014ffe95e30547a63af941b6727256f0d
parent6cc8076684db27e9bb3e320421e844a7cbcb2545 (diff)
downloadhaskell-221a104f44fdf58e4514d41ae827747c2bf938c8.tar.gz
codeGen: Fix header size for array write barriers
Previously the code generator's logic for invoking the nonmoving write barrier was inconsistent with the write barrier itself. Namely, the code generator treated the header size argument as being in words whereas the barrier expected bytes. This was the cause of #19715. Fixes #19715.
-rw-r--r--compiler/GHC/StgToCmm/Prim.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/GHC/StgToCmm/Prim.hs b/compiler/GHC/StgToCmm/Prim.hs
index a8dec42c9b..2db8e4cd38 100644
--- a/compiler/GHC/StgToCmm/Prim.hs
+++ b/compiler/GHC/StgToCmm/Prim.hs
@@ -2738,7 +2738,7 @@ emitCopyArray copy src0 src_off dst0 dst_off0 n =
dst_off <- assignTempE dst_off0
-- Nonmoving collector write barrier
- emitCopyUpdRemSetPush platform (arrPtrsHdrSizeW profile) dst dst_off n
+ emitCopyUpdRemSetPush platform (arrPtrsHdrSize profile) dst dst_off n
-- Set the dirty bit in the header.
emit (setInfo dst (CmmLit (CmmLabel mkMAP_DIRTY_infoLabel)))
@@ -2804,7 +2804,7 @@ emitCopySmallArray copy src0 src_off dst0 dst_off n =
dst <- assignTempE dst0
-- Nonmoving collector write barrier
- emitCopyUpdRemSetPush platform (smallArrPtrsHdrSizeW profile) dst dst_off n
+ emitCopyUpdRemSetPush platform (smallArrPtrsHdrSize profile) dst dst_off n
-- Set the dirty bit in the header.
emit (setInfo dst (CmmLit (CmmLabel mkSMAP_DIRTY_infoLabel)))
@@ -3165,7 +3165,7 @@ emitCtzCall res x width =
-- | Push a range of pointer-array elements that are about to be copied over to
-- the update remembered set.
emitCopyUpdRemSetPush :: Platform
- -> WordOff -- ^ array header size
+ -> ByteOff -- ^ array header size (in bytes)
-> CmmExpr -- ^ destination array
-> CmmExpr -- ^ offset in destination array (in words)
-> Int -- ^ number of elements to copy