RFR: 8368199: Add @AOTSafeClassInitializer to jdk.internal.access.SharedSecrets

Chen Liang liach at openjdk.org
Sat Oct 18 02:51:01 UTC 2025


On Fri, 17 Oct 2025 22:20:12 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> By annotating `SharedSecrets` as `@AOTSafeClassInitializer`, we can avoid using the `@AOTRuntimeSetup` annotations in a few JDK core classes. This simplifies the implementation. It also brings us closer to the goal of making the AOT cache as a true snapshot of the JVM state that just needs to be resumed in the production run.

src/java.base/share/classes/jdk/internal/access/SharedSecrets.java line 69:

> 67: public class SharedSecrets {
> 68:     // This field is not necessarily stable
> 69:     private static JavaAWTFontAccess javaAWTFontAccess;

Does aot initialization work with this field?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27880#discussion_r2441536894


More information about the security-dev mailing list