RFR: 8372617: Save and restore stubgen stubs when using an AOT code cache
Andrew Dinn
adinn at openjdk.org
Fri Nov 28 10:41:10 UTC 2025
On Thu, 20 Nov 2025 14:59:02 GMT, Andrew Dinn <adinn at openjdk.org> wrote:
> This PR adds save and restore of all generated stubs to the AOT code cache on x86 and aarch64. Other arches are modified to deal with the related generic PAI changes.
>
> Small changes were required to the aarch64 and x86_64 generator code in order to meet two key constraints:
> 1. the first declared entry of every stub starts at the first instruction in the stub code range
> 2. all data/code cross-references from one stub to another target a declared stub entry
This PR still needs to ensure that pre-universe stub entries are registered in the AOT address table. These stubs cannot be saved and restored because the AOT cache does not exist before universe init. As a consequence their addresses cannot be registered using the normal generate time mechanism. The required fix will be to add them via special case handling as soon as the AOT cache and address table have been initialised (preferably at the point where the majority of external addresses are registered).
This omission is not a problem for this patch i.e. as far as reference from existing stubs is concerned since none of the saved stubs targets to a pre-universe stub entry. However, they ought to be registered in case that situation changes or in case an nmethod that gets saved to and reloaded from the AOT cache needs at some point to target a pre-universe stub.
src/hotspot/cpu/aarch64/stubDeclarations_aarch64.hpp line 142:
> 140: do_arch_entry_init(aarch64, final, spin_wait, spin_wait, \
> 141: spin_wait, empty_spin_wait) \
> 142: /* stub only -- entries are not stored in StubRoutines::aarch64 */ \
Above comment is obsolete
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28433#issuecomment-3558574875
PR Review Comment: https://git.openjdk.org/jdk/pull/28433#discussion_r2555692076
More information about the hotspot-dev
mailing list