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

Thomas Schatzl tschatzl at openjdk.org
Wed Oct 29 11:35:00 UTC 2025


On Wed, 29 Oct 2025 11:27:52 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> 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.
>
> The `set_in_old` call is the giveaway - in the region attribute table you only set a region to "Old" if it is 
> 
>   static const region_type_t Old          =   1;    // The region is in the collection set and an old region.
> 
> Old regions not in the collection set are just `NotInCset`.

The "Young" and "NewSurvivor" do not have the `collection_set` tagging because they are always in the collection set (i.e. it's obvious).

I thought it would be good to make it clear in the name that for old regions, we only add (old) regions that are part of the collection set.

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

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


More information about the hotspot-gc-dev mailing list