RFR: Move affiliation and mode out of ShenandoahGenerationalMode [v2]

Aleksey Shipilev shade at openjdk.org
Thu Apr 6 16:46:58 UTC 2023


On Thu, 6 Apr 2023 16:34:53 GMT, William Kemper <wkemper at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahOldGeneration.cpp line 185:
>> 
>>> 183: bool ShenandoahOldGeneration::contains(ShenandoahHeapRegion* region) const {
>>> 184:   // TODO: Should this be region->is_old() instead?
>>> 185:   return !region->is_young();
>> 
>> Agree with proposed change.  How could this not be a problem?   Is it used?
>
> We have to be careful with this one because some uses expect to visit regions that are both old _and_ free (or young _and_ free). Maybe we should get rid of this method and be explicit about it?

Yeah, I would have expected `ShenandoahOldGeneration::contains` to look like the alias for `is_old`. I think `ShenandoahYoungGeneration::contains` has the opposite problem. That is something for a separate PR.

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

PR Review Comment: https://git.openjdk.org/shenandoah/pull/246#discussion_r1160032281


More information about the shenandoah-dev mailing list