Commit d40d6df7 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

StgCmmPrim: Add missing MO_WriteBarrier

Test Plan: Good question

Reviewers: austin, trommler, simonmar, rrnewton

Reviewed By: simonmar

Subscribers: RyanGlScott, thomie

Differential Revision: https://phabricator.haskell.org/D2495

GHC Trac Issues: #12469
parent d790cb9d
......@@ -308,8 +308,11 @@ emitPrimOp _ [res] GetCurrentCCSOp [_dummy_arg]
emitPrimOp dflags [res] ReadMutVarOp [mutv]
= emitAssign (CmmLocal res) (cmmLoadIndexW dflags mutv (fixedHdrSizeW dflags) (gcWord dflags))
emitPrimOp dflags [] WriteMutVarOp [mutv,var]
= do emitStore (cmmOffsetW dflags mutv (fixedHdrSizeW dflags)) var
emitPrimOp dflags res@[] WriteMutVarOp [mutv,var]
= do -- Without this write barrier, other CPUs may see this pointer before
-- the writes for the closure it points to have occurred.
emitPrimCall res MO_WriteBarrier []
emitStore (cmmOffsetW dflags mutv (fixedHdrSizeW dflags)) var
emitCCall
[{-no results-}]
(CmmLit (CmmLabel mkDirty_MUT_VAR_Label))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment