RFR: 8221648: Remove CollectedHeap::is_in_closed_subset()

Kim Barrett kim.barrett at oracle.com
Sun Mar 31 05:03:07 UTC 2019

> On Mar 28, 2019, at 5:49 PM, Per Liden <per.liden at oracle.com> wrote:
> I propose that we remove CollectedHeap::is_in_closed_subset() and its unused sibling CollectedHeap::is_in_closed_subset_or_null(). We can replace all calls to is_in_closed_subset(), most of which is in verification code, with calls to is_in(). For Serial and ZGC, is_in_closed_subset() is already equivalent to is_in(). For G1, is_in_closed_subset() is very close to equivalent to is_in(). For CMS, Parallel, Epsilon, and Shenandoah, is_in_closed_subset() is equivalent to is_in_reserved(). However, their is_in() is arguably not a lot more expensive, at least not to the degree that is motivates keeping the is_in_closed_subset() API around. G1 is the only GC that calls is_in_closed_subset() outside of verification code (in RegisterHumongousWithInCSetFastTestClosure).
> Bug: https://bugs.openjdk.java.net/browse/JDK-8221648
> Webrev: http://cr.openjdk.java.net/~pliden/8221648/webrev.0
> /Per

Looks good.

The comment for is_in_closed_subset() claims is_in() verifies the
argument is actually an object, but the implementations of is_in()
that I looked at don't seem to do anything of the kind. Which reduces
the cost difference that was the justification for is_in_closed_subset.

This change trivially slows the setup for potential eager reclaim of
humongous regions, but I agree that doesn't seem important.  If it did
matter we could just inline the part of is_in() that's needed there.

More information about the hotspot-gc-dev mailing list