RFR (XS) 8185160 -XX:DumpLoadedClassList omits graal classes

Ioi Lam ioi.lam at oracle.com
Wed Oct 18 03:52:15 UTC 2017


http://cr.openjdk.java.net/~iklam/jdk10/8185160-dump-class-list-omits-graal.v01/
https://bugs.openjdk.java.net/browse/JDK-8185160

Summary:

DumpLoadedClassList skips classes that can't be stored into the CDS
archive. For boot and platform loaders, only classes from the JRT image
are listed.

The test for "is this class from JRT image" was insufficient. It checked 
only
classes whose source ends with "...../modules". For the platform loader, 
which loads
the graal classes, the source is in the form 
"jrt:/jdk.internal.vm.compiler".

The fix is to also check for a "jrt:" prefix.

I also restructured the code to make it easier to read -- the nesting of 
|| and &&
is hard to follow.

The original code had a subtle bug with the "!" operator:

5938   if (((class_loader == NULL && 
!ClassLoader::contains_append_entry(stream->source())) ||
5939 SystemDictionary::is_platform_class_loader(class_loader)) &&
5940       !ClassLoader::is_jrt(stream->source())) {

So if (class_loader == NULL && 
ClassLoader::contains_append_entry(stream->source()) was true,
the class would NOT be skipped.

The new version removes the "!".

Thanks
- Ioi


More information about the hotspot-runtime-dev mailing list