RFR: 8321225: [JVMCI] HotSpotResolvedObjectTypeImpl.isLeafClass shouldn't create strong references

Erik Österlund eosterlund at openjdk.org
Tue Dec 5 08:02:32 UTC 2023


On Mon, 4 Dec 2023 05:36:38 GMT, Tom Rodriguez <never at openjdk.org> wrote:

> Checking for leaf Klasses requires seeing if the subklass field is null.  As part of the fix for JVMCI support for ZGC, JDK-8299229, it was changed to call into the runtime which had the side effect of creating a strong reference to an the class.  Since it's only checking for non-null it's ok to just perform thread directly as was done prior to JDK-8299229.  This avoids causing class unloading problems.

Looks good. I suppose this can yield some false negatives when the link isn't null but the subclass is concurrently unloading. But that probably doesn't matter, and you would have received the same negative answer had it been asked a bit earlier.

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

Marked as reviewed by eosterlund (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/16943#pullrequestreview-1764242534


More information about the hotspot-compiler-dev mailing list