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_atcallsobject_reference_write_postafter callingBarrierSetAssembler::store_at. However,BarrierSetAssembler::store_atmodifies thevalregister to compress its value in place. Consequently,object_reference_write_postwill see a compressed pointer in thevalregister.This PR makes two changes.
Firstly, in
MMTkObjectBarrierSetAssembler::object_reference_write_post, we simply set bothc_rarg1andc_rarg2to 0 before calling the write barrier slow path. We exploit the semantics of theObjectBarrierthat 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 aNoneof typeOption<ObjectReference>.Secondly, we add a
bool compensate_val_regparameter toMMTkBarrierSetAssembler::object_reference_write_postso that if we call it afterBarrierSetAssembler::store_at, we can giveobject_reference_write_posta chance to decompress the compressed oop in theval. This is intended for implementing other barriers introduced in the future that may use thevalregister, and keep the developers informed that thevalregister is mutated inBarrierSetAssembler::store_at.Fixes: #291
Related PR: #293