RFR: 8265604: Support unlinked classes in dynamic CDS archive

Yumin Qi minqi at openjdk.java.net
Fri Jul 16 17:44:54 UTC 2021


On Fri, 16 Jul 2021 01:40:36 GMT, Calvin Cheung <ccheung 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

Looks good. Small nits.

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)

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?

test/hotspot/jtreg/runtime/cds/appcds/dynamicArchive/test-classes/CustomLoaderApp.java line 57:

> 55:             Object o = c.newInstance();
> 56: 
> 57: 

extra empty line.

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

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


More information about the hotspot-runtime-dev mailing list