Some accounting only needs to happen when visiting the
object for the first time. The complete barrier is simply:
object->field = newValue;
if (object->cellState == Old)
remember(object);
This surely elides some synchronization? One would think that either this has to communicate with the collector (to prevent a racing concurrent collection from missing the referent), or happen in the opposite order.Or perhaps it is relying on the calling mutator thread necessarily holding a reference to the young object in question? Even then there is some non-trivial ordering work to be done here (in particular on weakly ordered architectures.)
I'm sure this is well handled but as this is one of the main difficulties in implementing good write barriers I am curious what they did.