RFR: 8293187: Store initialized Enum classes in AOTCache [v3]

Ashutosh Mehra asmehra at openjdk.org
Wed Sep 18 14:33:08 UTC 2024


On Wed, 18 Sep 2024 00:59:22 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> That's why there's no check for k to be aot-initialized.

I was actually referring to the missing aot-initialized check for the Fruit class.
As it stands, this method initializes the classes required by the archive mirrors as the _runtime_default_subgraph_info has all the archived mirrors. But not all classes that have archived mirror are aot-initialized. And from the Fruit class example in the comment it seems this method should only be initializing the classes that are required by archived mirrors of _aot-initialized classes_:


// For example, if this enum class is initialized at AOT cache assembly time:
//
//    enum Fruit {
//       APPLE, ORANGE, BANANA;
//       static final Set<Fruit> HAVE_SEEDS = new HashSet<>(Arrays.asList(APPLE, ORANGE));
//   }
//
// the pre-inited mirror of Fruit references HashSet, which should be initialized
// before any Java code can access the Fruit class.


So based on the comment there should be a way to identify the subgraph_object_klasses of only the aot-initialized classes and initialize only those classes.
Am I reading this wrong?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/20958#discussion_r1765170921


More information about the hotspot-dev mailing list