RFR: 8371874: AOTLinkedClassBulkLoader::preload_classes() should not allocate heap objects
Aleksey Shipilev
shade at openjdk.org
Fri Nov 14 07:35:06 UTC 2025
On Fri, 14 Nov 2025 04:43:51 GMT, Ioi Lam <iklam at openjdk.org> wrote:
> `AOTLinkedClassBulkLoader::preload_classes()` indirectly calls `java_lang_Class::restore_archived_mirror()` which can allocate an `int` array for the `init_lock`. However, the `init_lock` has already been allocated during AOT cache assembly :
>
>
> java_lang_Class::create_scratch_mirror()
> -> allocate_mirror()
> -> initialize_mirror_fields()
> -> set_init_lock()
>
>
> So there's no need to allocate it again in the production run.
Marked as reviewed by shade (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/28315#pullrequestreview-3463270588
More information about the hotspot-runtime-dev
mailing list