RFR: 8372617: Save and restore stubgen stubs when using an AOT code cache
Vladimir Kozlov
kvn at openjdk.org
Fri Nov 28 10:41:13 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
I noticed that we have to add a lot of local data tables addresses for stubs (math intrinsics).
May be we should consider to have platform specific AOT address tables for such address (and platform specific stubs). To avoid search in one big table.
src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp line 611:
> 609: return start;
> 610: }
> 611:
This code pattern repeats a lot. Can we move it into `load_archive_data()`?
address start = load_archive_data(stub_id);
if (start != nullptr) {
return start;
}
And have an other specialized `load_archive_data` if you need `end` value.
src/hotspot/cpu/aarch64/stubGenerator_aarch64.cpp line 13115:
> 13113: StubRoutines::aarch64::init_AOTAddressTable(external_addresses);
> 13114: AOTCodeCache::publish_external_addresses(external_addresses);
> 13115: }
This and `*init_AOTAddressTable()` methods should be under `#if INCLUDE_CDS`
src/hotspot/share/runtime/stubRoutines.cpp line 317:
> 315: // Non-generated init method
> 316:
> 317: void StubRoutines::init_AOTAddressTable() {
Can this body be in platform specific file.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28433#issuecomment-3560789636
PR Review Comment: https://git.openjdk.org/jdk/pull/28433#discussion_r2548099002
PR Review Comment: https://git.openjdk.org/jdk/pull/28433#discussion_r2548115066
PR Review Comment: https://git.openjdk.org/jdk/pull/28433#discussion_r2548124630
More information about the hotspot-dev
mailing list