RFR: 8289822: G1: Make concurrent mark code owner of TAMSes [v2]
Albert Mingkun Yang
ayang at openjdk.org
Thu Mar 14 17:49:38 UTC 2024
On Thu, 14 Mar 2024 15:43:21 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:
>> src/hotspot/share/memory/iterator.hpp line 44:
>>
>>> 42: // The following classes are C++ `closures` for iterating over objects, roots and spaces
>>> 43:
>>> 44: class Closure : public CHeapObj<mtGC> { };
>>
>> Why is this required (in this PR)?
>
> The changes need to allocate `G1CollectedHeap::_is_alive_closure_cm` when creating that argument for creating the concurrent reference processor. Previously the closure used `G1CollectedHeap` which is available when inlining it into the `G1CollectedHeap` instance, but now the closure needs `G1ConcurrentMark` which is not available at that time (i.e. null).
> The alternative would have been introducing something like an `initialize` method to that closure which I did not like.
OK, could `G1CMIsAliveClosure::do_object_b` retrieve `_cm` via `_g1h`? (It's obvious why `Closure` is part of mtGC here.)
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18150#discussion_r1525283735
More information about the hotspot-gc-dev
mailing list