RFR: 8278131: runtime/cds/appcds/dynamicArchive/* tests failing in loom repo

Calvin Cheung ccheung at openjdk.java.net
Wed Dec 15 17:38:58 UTC 2021


On Wed, 15 Dec 2021 05:44:03 GMT, David Holmes <dholmes at openjdk.org> wrote:

> > Sorry should have been more specific. I'm looking at test/hotspot/jtreg/runtime/HiddenClasses/InstantiateHiddenClass.java where the hidden class is stored in the new field.
> 
> Okay so that test has nothing to do with dynamic dumping. But if you wanted to keep the hidden classes alive you create with STRONG so they are strongly associated with their classloader. But I can't see why that test would need that anyway.

The appcds/dynamicArchive/RegularHiddenClass.java test makes use of the InstantitateHiddenClass and attempts
to dump a hidden class into the dynamic archive.

I've tried your suggestion on using the STRONG `ClassOption` as follows and it also works. Will update the webrev.


-        Class<?> c1 = lookup.defineHiddenClass(klassbuf, false, NESTMATE).lookupClass();
-        Class<?> c2 = lookup.defineHiddenClass(klassbuf, false, NESTMATE).lookupClass();
+        ClassOption classOption = keepAlive ? STRONG : NESTMATE;
+        Class<?> c1 = lookup.defineHiddenClass(klassbuf, false, classOption).lookupClass();
+        Class<?> c2 = lookup.defineHiddenClass(klassbuf, false, classOption).lookupClass();

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

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


More information about the hotspot-runtime-dev mailing list