Skip val register in ObjectBarrier impl #294
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MMTkBarrierSetAssembler::store_at
callsobject_reference_write_post
after callingBarrierSetAssembler::store_at
. However,BarrierSetAssembler::store_at
modifies theval
register to compress its value in place. Consequently,object_reference_write_post
will see a compressed pointer in theval
register.This PR makes two changes.
Firstly, in
MMTkObjectBarrierSetAssembler::object_reference_write_post
, we simply set bothc_rarg1
andc_rarg2
to 0 before calling the write barrier slow path. We exploit the semantics of theObjectBarrier
that it simply logs the object without looking at the slot or the target. This will fix the assertion error because 0 will be interpreted as aNone
of typeOption<ObjectReference>
.Secondly, we add a
bool compensate_val_reg
parameter toMMTkBarrierSetAssembler::object_reference_write_post
so that if we call it afterBarrierSetAssembler::store_at
, we can giveobject_reference_write_post
a chance to decompress the compressed oop in theval
. This is intended for implementing other barriers introduced in the future that may use theval
register, and keep the developers informed that theval
register is mutated inBarrierSetAssembler::store_at
.Fixes: #291
Related PR: #293