RFR: 8247740: Inline derived CollectedHeap access for G1 and ParallelGC

Kim Barrett kim.barrett at oracle.com
Wed Jun 17 12:32:18 UTC 2020


Please review this change to derived CollectedHeap access for the
various collectors.  Most of the collectors have a heap() function
that returns the derived CollectedHeap object, with the definitions of
these functions being nearly identical.  This change adds a helper
function in CollectedHeap for use by these derived heap() functions.

This change also inlines the heap() functions for G1 and ParallelGC.
These functions have a very simple definition in a release build.
Since both of these collectors have calls in relatively performance
critical places, inlining should be (a little bit) helpful, though I
haven't tried to measure it.  In some cases it may be better to get
the heap once and cache it in a variable or data member; indeed,
that's often done, but not always, and tracking down all the cases
that matter isn't a small task.

This change only does the inlining for G1 and ParallelGC.  Performance
of Serial and Epsilon is less critical, and ZGC does a good job of
avoiding hot calls.  Shenandoah doesn't have a corresponding function;
it seems to have not conformed to the JDK-8077415 change.

CR:
https://bugs.openjdk.java.net/browse/JDK-8247740

Webrev:
https://cr.openjdk.java.net/~kbarrett/8247740/open.00/

Testing:
mach5 tier1




More information about the hotspot-gc-dev mailing list