Note [Nonmoving write barrier in Perform{Put,Take}]

rts/PrimOps.cmm:1583 rts 1 ticket

As noted in Note [Non-moving garbage collector] in NonMoving.c, the
non-moving GC requires that all overwritten pointers be pushed to the update
remembered set. In the case of stack mutation this typically happens by
"dirtying" the stack, which eagerly traces the entire stack chunk.

An exception to this rule is PerformPut, which mutates the stack of a
blocked thread (overwriting an stg_block_putmvar frame). To ensure that the
collector sees the MVar and value reachable from the overwritten frame, we
must push them to the update remembered set. Failing to do so was the cause
of #20399.

Note that unlike PerformPut, the callers of PerformTake first dirty the
stack prior mutating it (since they introduce a *new*, potentially
inter-generational reference to the stack) and therefore the barrier
described above is unnecessary in this case.
-------------------------------------------------------------------------- 

References 0

This Note does not link to any other.

Referenced by 3