summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGHC GitLab CI <ghc-ci@gitlab-haskell.org>2021-06-11 00:41:19 +0000
committerZubin Duggal <zubin.duggal@gmail.com>2021-06-27 16:49:14 +0530
commit616196cc8588e8b668d511c67004b6df36c6f486 (patch)
tree5670bcf26e63aeb875a37095e2c4012a7b33dea2
parent8b2554efe0ed942c3861c69963ce3ec1e72eb08e (diff)
downloadhaskell-616196cc8588e8b668d511c67004b6df36c6f486.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. (cherry picked from commit 221a104f44fdf58e4514d41ae827747c2bf938c8)
-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 f6689ff979..9d780b451d 100644
--- a/compiler/GHC/StgToCmm/Prim.hs
+++ b/compiler/GHC/StgToCmm/Prim.hs
@@ -2599,7 +2599,7 @@ emitCopyArray copy src0 src_off dst0 dst_off0 n =
dst_off <- assignTempE dst_off0
-- Nonmoving collector write barrier
- emitCopyUpdRemSetPush dflags (arrPtrsHdrSizeW dflags) dst dst_off n
+ emitCopyUpdRemSetPush dflags (arrPtrsHdrSize dflags) dst dst_off n
-- Set the dirty bit in the header.
emit (setInfo dst (CmmLit (CmmLabel mkMAP_DIRTY_infoLabel)))
@@ -2664,7 +2664,7 @@ emitCopySmallArray copy src0 src_off dst0 dst_off n =
dst <- assignTempE dst0
-- Nonmoving collector write barrier
- emitCopyUpdRemSetPush dflags (smallArrPtrsHdrSizeW dflags) dst dst_off n
+ emitCopyUpdRemSetPush dflags (smallArrPtrsHdrSize dflags) dst dst_off n
-- Set the dirty bit in the header.
emit (setInfo dst (CmmLit (CmmLabel mkSMAP_DIRTY_infoLabel)))
@@ -2987,7 +2987,7 @@ emitCtzCall res x width = do
-- | Push a range of pointer-array elements that are about to be copied over to
-- the update remembered set.
emitCopyUpdRemSetPush :: DynFlags
- -> 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