RFR: 8261941: Use ClassLoader for unregistered classes during -Xshare:dump

Calvin Cheung ccheung at openjdk.java.net
Tue Sep 14 05:15:13 UTC 2021


On Fri, 10 Sep 2021 22:19:11 GMT, Ioi Lam <iklam at openjdk.org> wrote:

>> Before this change, unregistered classes are loaded by the boot class loader during CDS dump time.
>> This RFE creates an URLClassLoader based on the source specified in the classlist and uses the URLClassLoader to load the unregistered class during CDS dump time. The URLClassLoader instances will be cached in a hash table with the source as the key so that classes associated with the same source will be loaded by the same instance of class loader.
>> 
>> Passed tiers 1 - 4 testing.
>
> src/hotspot/share/cds/classListParser.cpp line 476:
> 
>> 474:   }
>> 475: 
>> 476:   // This tells JVM_FindLoadedClass to not find this class.
> 
> This comment can be deleted.
> 
> The class `k` used to be defined by the boot loader. As a result, when `JVM_FindLoadedClass` looked up a class in the boot/platform/app loaders, it may inadvertently find `k`.
> 
> However, after this PR, `k` is no longer defined by the boot loader.

Removed the comment.

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

PR: https://git.openjdk.java.net/jdk/pull/5458


More information about the hotspot-runtime-dev mailing list