RFR: 8368199: Add @AOTSafeClassInitializer to jdk.internal.access.SharedSecrets [v2]
Ioi Lam
iklam at openjdk.org
Tue Oct 28 04:06:41 UTC 2025
On Mon, 27 Oct 2025 08:48:40 GMT, Per Minborg <pminborg at openjdk.org> wrote:
>> Ioi Lam has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Added StatelessOopsFinder
>
> src/hotspot/share/cds/cdsHeapVerifier.cpp line 186:
>
>> 184: if (fd->signature()->starts_with("Ljdk/internal/access/") &&
>> 185: fd->signature()->ends_with("Access;")) {
>> 186: // The jdk/internal/access/*Access classes carry no states so they can be safely
>
> This might be true for the time being, but adding such an assumption is a constraint for the future and should be documented. Perhaps we should have an interface `Access` that the various access classes implement, and where we could document this and other constraints of the access classes.
I removed this hard-coded check and instead added `CDSHeapVerifier::add_shared_secret_accessors()`, which requires all AOT-initialized accessors to be stateless.
I also added a negative test case for `SharedSecrets::javaObjectInputFilterAccess`, which is not stateless so it cannot be initialized in the AOT assembly phase.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27880#discussion_r2467807545
More information about the hotspot-runtime-dev
mailing list