-
Notifications
You must be signed in to change notification settings - Fork 38
WIP: Refactor barrier implementation #332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
They are not specific to concrete barriers, although each barrier only uses some but not all of them.
And no define private as public.
and move the slow-path stub to UnlogBarrierSet, too. And combine the pre and post barrier stub.
This is the basic rule for using pre-compiled headers.
SATB barrier does not have arraycopy epilogue.
... so that we can debug ref-load barriers without recompilation.
I think we should specify in the type that this is an object remembering barrier. LXR's field remembering barrier would also be an "unlog-bit" barrier but it's a different implementation. |
I chose the name MMTkUnlogBitBarrierSet because the mmtk-core simply calls the metadata "unlog bit" or just "log bit". But I think it is worth emphasizing that it is "object unlog bit" or "object remembering barrier" rather than "field unlog bit" or "field remembering barrier". But I hesitate to change the name now because "MMTkObjectUnlogBitBarrier" and "MMTkObjectRememberingBarrier" are both similar to the current "MMTkObjectBarrier", and the longer name feels like it should be a subclass rather than superclass. It is also a bit confusing because both "ObjectBarrier" and "SATBBarrier" are object-logging. I think we should rename "ObjectBarrier" to a more meaningful name, such as "object modification barrier". We can discuss this in a group. |
https://github.com/mmtk/mmtk-openjdk/actions/runs/17941785053/job/51021271068?pr=332 |
Another failure https://github.com/mmtk/mmtk-openjdk/actions/runs/17941785053/job/51021285329?pr=332 was a "duplicated edges" error in SemiSpace. It was already reported. See #331 |
Restore src, slot and new_val, even if they are unused.
Maybe start an issue instead.
We recently added another write barrier, the
SATBBarrier
. Being another barrier based on the per-object unlog bit, it shares much code with theObjectBarrier
. We refactor the write barriers to improve code sharing and clean up unused code.We introduce abstract base classes
MMTkUnlogBitBarrierSetRuntime
,MMTkUnlogBitBarrierSetAssembler
,MMTkUnlogBitBarrierSetC1
andMMTkUnlogBitBarrierSetC2
, which bothObjectBarrier
andSATBBarrier
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:
Assembler:
tmp1
andtmp2
temporary registers passed in fromBarrierSetAssembler::store_at
may overlap withdst.base()
anddst_index()
, respectively.C1:
MMTkBarrierSetAssembler
instead of byMMTkObjectBarrierSetAssembler
orMMTkSATBBarrierSetAssembler
. The intention is that all barriers can call those functions.slot
andnew_val
to the runtime function in the slow path. Object-logging barriers only needs theobj
argument for scanning its fields.mmtkBarrierSetC1.hpp
tommtkUnlogBitBarrier.hpp
(and unified the pre/post stub implementation) because it no longer needs theslot
ornew_val
args, and is now specific to unlog bit barriers. If we introduce field-logging barriers, we will implement a different stub.MMTkBarrierSetC1::object_reference_write_{pre,post}
so that they only hvae theLIRAccess& access
parameter. The slot and the new value can be obtained form theaccess
argument, too, but we don't need them in object-logging barriers.mmtk_object_reference_write_pre
), not using LIR instructions.C2:
Misc:
#define private public
hack as we no longer need it.SOFT_REFERENCE_LOAD_BARRIER
to a run-time flagmmtk_enable_reference_load_barrier
settable by environment variable.