You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We recently added another write barrier, the `SATBBarrier`. Being
another barrier based on the per-object unlog bit, it shares much code
with the `ObjectBarrier`. We refactor the write barriers to improve code
sharing and clean up unused code.
We introduce abstract base classes `MMTkUnlogBitBarrierSetRuntime`,
`MMTkUnlogBitBarrierSetAssembler`, `MMTkUnlogBitBarrierSetC1` and
`MMTkUnlogBitBarrierSetC2`, which both `ObjectBarrier` and `SATBBarrier`
derive from. Those base classes include common parts related to unlog
bit handling, including the fast paths for checking if the unlog bit is
set, and also the generic implementation for both the pre and the post
barriers if applicable.
Runtime:
- Extracted a method for testing if the unlog bit is set for a given
object.
Assembler:
- Extracted a method for emitting the unlog bit checking fast path.
- Extracted a method for generating both the pre and the post write
barriers.
- Simplified the fast path to use fewer instructions and fewer scratch
registers.
- Worked around an issue where the `tmp1` and `tmp2` temporary registers
passed in from `BarrierSetAssembler::store_at` may overlap with
`dst.base()` and `dst_index()`, respectively.
- See https://bugs.openjdk.org/browse/JDK-8301371
C1:
- Changed "runtime stubs" to be one per runtime function, not one per
pre/post/refload barrier. Those "runtime stubs" are now assembled by
`MMTkBarrierSetAssembler` instead of by `MMTkObjectBarrierSetAssembler`
or `MMTkSATBBarrierSetAssembler`. The intention is that all barriers can
call those functions.
- Extracted a method for emitting the unlog bit checking fast path.
- Extracted a method for emitting both the pre and the post write
barriers and their slow-path code stub.
- We no longer pass the `slot` and `new_val` to the runtime function in
the slow path. Object-logging barriers only needs the `obj` argument for
scanning its fields.
- For this reason, we moved the C1 CodeStub for the pre/post barrier
slow paths down from `mmtkBarrierSetC1.hpp` to `mmtkUnlogBitBarrier.hpp`
(and unified the pre/post stub implementation) because it no longer
needs the `slot` or `new_val` args, and is now specific to unlog bit
barriers. If we introduce field-logging barriers, we will implement a
different stub.
- The C1 SATBBarrier no longer needs code patching. The code patching
was intended for barriers that load from the field in the fast path
using LIR instructions, such as G1's SATB barrier. Our object-logging
barrier scans the fields in runtime functions
(`mmtk_object_reference_write_pre`), not using LIR instructions.
C2:
- Extracted a method for emitting the unlog bit checking fast path.
- Extracted a method for emitting both the pre and the post write
barriers.
- We no longer pass the `slot` and `new_val` to the runtime function in
the slow path.
Misc:
- Removed the `#define private public` hack as we no longer need it.
- Removed unused macros, dead code and irrelevant comments.
- Changed the macro `SOFT_REFERENCE_LOAD_BARRIER` to a run-time flag
`mmtk_enable_reference_load_barrier` settable by environment variable.
0 commit comments