summaryrefslogtreecommitdiff
path: root/compiler/codeGen
diff options
context:
space:
mode:
authorÖmer Sinan Ağacan <omeragacan@gmail.com>2019-02-22 10:44:27 +0300
committerBen Gamari <ben@smart-cactus.org>2019-02-22 11:38:57 -0500
commit6698bbadb99695e97f0f07b36f57dd06193074ae (patch)
tree41f75effa2f1802a60cc8364d50d2bd4b46d8aba /compiler/codeGen
parenta4f7fc5e8a3002f19b78d7982735a2d42dd744b1 (diff)
downloadhaskell-wip/nonmoving-gc.tar.gz
Remove origin arguments from write barrier functionswip/nonmoving-gc
Write barriers push old values of updated field, e.g. when we have *q = p; we do updateRemembSetPushClosure(*q, q); *q = p; Here the second argument ("origin") is not useful because by the time we do the update we invalidate "origin" (`q` is no longer origin of old `*q`). In general it doesn't make sense to record origins in write barriers so we remove all origin arguments from write barriers. Fixes #170.
Diffstat (limited to 'compiler/codeGen')
-rw-r--r--compiler/codeGen/StgCmmPrim.hs12
1 files changed, 4 insertions, 8 deletions
diff --git a/compiler/codeGen/StgCmmPrim.hs b/compiler/codeGen/StgCmmPrim.hs
index ee46bbf946..ddef4fa0fd 100644
--- a/compiler/codeGen/StgCmmPrim.hs
+++ b/compiler/codeGen/StgCmmPrim.hs
@@ -1623,7 +1623,7 @@ doWritePtrArrayOp addr idx val
hdr_size = arrPtrsHdrSize dflags
-- Update remembered set for non-moving collector
whenUpdRemSetEnabled
- $ emitUpdRemSetPush dflags (cmmLoadIndexOffExpr dflags hdr_size ty addr ty idx)
+ $ emitUpdRemSetPush (cmmLoadIndexOffExpr dflags hdr_size ty addr ty idx)
-- This write barrier is to ensure that the heap writes to the object
-- referred to by val have happened before we write val into the array.
-- See #12469 for details.
@@ -2569,19 +2569,15 @@ whenUpdRemSetEnabled = id -- TODO
-- | Emit code to add an entry to a now-overwritten pointer to the update
-- remembered set.
-emitUpdRemSetPush :: DynFlags
- -> CmmExpr -- ^ value of pointer which was overwritten
+emitUpdRemSetPush :: CmmExpr -- ^ value of pointer which was overwritten
-> FCode ()
-emitUpdRemSetPush dflags ptr = do
+emitUpdRemSetPush ptr = do
emitRtsCall
rtsUnitId
(fsLit "updateRemembSetPushClosure_")
[(CmmReg (CmmGlobal BaseReg), AddrHint),
- (ptr, AddrHint),
- (origin, AddrHint)]
+ (ptr, AddrHint)]
False
- where
- origin = zeroExpr dflags
-- | Push a range of pointer-array elements that are about to be copied over to
-- the update remembered set.