RFR: 8370807: G1: Improve region attribute table method naming

Albert Mingkun Yang ayang at openjdk.org
Wed Oct 29 11:11:53 UTC 2025


On Wed, 29 Oct 2025 10:56:44 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp line 207:
>> 
>>> 205: }
>>> 206: 
>>> 207: void G1CollectedHeap::register_old_collection_set_region_with_region_attr(G1HeapRegion* r) {
>> 
>> Why "collection_set" in the name? Is it a precondition that `r` is in cset?
>
> It must be a region that is currently being added to the collection set. I.e. registered to the attribute table to be in the collection set.

Then `in_cset` is a postcondition, not a precondition. The new name seems to suggest the arg (`r`) is old + in_cset, as a precondition.

Looking at the impl, one can't see anything related to "collection_set" in this context. I'd suggest restoring the original name, but YMMV.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/28038#discussion_r2472587774


More information about the hotspot-gc-dev mailing list