pub fn object_reference_write_post<VM: VMBinding>(
    mutator: &mut Mutator<VM>,
    src: ObjectReference,
    slot: VM::VMSlot,
    target: Option<ObjectReference>
)
Expand description

The write barrier by MMTk. This is a post write barrier, which we expect a binding to call after it modifies an object. For performance reasons, a VM should implement the write barrier fast-path on their side rather than just calling this function.

For a correct barrier implementation, a VM binding needs to choose one of the following options:

  • Use subsuming barrier object_reference_write
  • Use both object_reference_write_pre and object_reference_write_post, or both, if the binding has difficulty delegating the store to mmtk-core with the subsuming barrier.
  • Implement fast-path on the VM side, and call the generic api object_reference_write_slow as barrier slow-path call.
  • Implement fast-path on the VM side, and do a specialized slow-path call.

Arguments:

  • mutator: The mutator for the current thread.
  • src: The modified source object.
  • slot: The location of the field to be modified.
  • target: The target for the write operation. None if the slot no longer hold an object reference after the write operation. This may happen when writing a null reference, a small integers, or a special value such astrue, false, undefined, etc., into the slot.