RFR: 8265604: Support unlinked classes in dynamic CDS archive

Calvin Cheung ccheung at openjdk.java.net
Sat Jul 17 00:25:55 UTC 2021


On Fri, 16 Jul 2021 17:33:51 GMT, Yumin Qi <minqi at openjdk.org> wrote:

>> This change adds the capability of storing unlinked class in dynamic CDS archive.
>> Before this change, unlinked classes loaded by custom class loaders won't be store in dynamic CDS archive.
>> Unlinked old classes with version < JAVA_6_VERSION will also be supported by this change. Similar to the support for old classes in static CDS archive in [JDK-8261090](https://bugs.openjdk.java.net/browse/JDK-8261090).
>> 
>> Testing:
>> 
>> - [x] tiers1,2,3,4
>
> src/hotspot/share/cds/metaspaceShared.cpp line 590:
> 
>> 588:     // It's OK to do this for the built-in loaders as we know they can
>> 589:     // tolerate this. (Note that unregistered classes are loaded by the NULL
>> 590:     // loader during DumpSharedSpaces).
> 
> DumpSharedSpace -> dump time. (All classes are loaded by boot class loader at dump time)

During dynamic dump, an unregistered class could be loaded by a custom loader.

> src/hotspot/share/oops/instanceKlass.cpp line 940:
> 
>> 938:       // 2) the class is loaded by built-in class loader but failed to add archived loader constraints
>> 939:       bool need_init_table = true;
>> 940:       if (is_shared() && verified_at_dump_time() &&
> 
> Should comment be updated for the change?

I will update the comment to the following:

      // 1) the class is loaded by custom class loader or
      // 2) the class is loaded by built-in class loader but failed to add archived loader constraints or
      // 3) the class was not verified during dump time

> test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/test-classes/CustomLoaderApp.java line 57:
> 
>> 55:             Object o = c.newInstance();
>> 56: 
>> 57: 
> 
> extra empty line.

I'll delete the empty lines.
Thanks for your review.

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

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


More information about the hotspot-runtime-dev mailing list