RFR(s): 8221539: [metaspace] Improve MetaspaceObj::is_metaspace_obj() and friends

Thomas Stüfe thomas.stuefe at gmail.com
Wed Mar 27 21:01:25 UTC 2019

Hi all,

May I please have reviews for this small optimization:

Issue: https://bugs.openjdk.java.net/browse/JDK-8221539

There are several functions which, given an unknown pointer assumed to be a
metaspace object, check if the pointer is indeed a metaspace object by
walking the VirtualSpaceList and checking ranges.

This patch adds checks which weed out the obvious cases to avoid needlessly
walking the vs list.

Patch also adds verifications for the VirtualSpaceList in debug cases.
Those run only when a new node has been added to the list, or when a node
has been purged, so very sparingly.

When purging nodes, I removed a small unnecessary and inefficient check
which checked whether (one of the) purged nodes was still in the list.
Since we now as part of the new VirtualSpaceNode::verify() walk this list,
the check is unnecessary.

Thanks, Thomas

More information about the hotspot-runtime-dev mailing list