RFR: 8372617: Save and restore stubgen stubs when using an AOT code cache
Vladimir Kozlov
kvn at openjdk.org
Mon Jan 26 17:53:57 UTC 2026
On Tue, 20 Jan 2026 17:21:46 GMT, Andrew Dinn <adinn at openjdk.org> wrote:
>> 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.
>
> @vnkozlov
>
>> 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.
>
> I think we only need to search the the _extrs address list when we are saving stub or nmethod blobs and need to translate a target address to a table index. When loading code we simply use an index to lookup the corresponding address. So, performance is only an issue for the assembly phase.
>
> I don't think splitting the externals tables is going to be much help. If we flag stubs as arch-specific or generic then, sure, we can bypass the local externals table if we are saving a generic stub. But that does not avoid what is essentially an o(n^2) lookup, it merely reduces it by a constant factor (ratio of generic external references to all external references) that is not that much less than 1.
>
> I suggest instead that during stub save we populate a hash table of <address, int> whenever we insert a new external address into the table. That way we can do the lookup in constant time. How does that sound?
@adinn A lot of tests failed running with `-XX:+AOTClassLinking -XX:+UseZGC` and also other GCs except G1.
It failed to find CodeBlob:
#
# Internal Error (c:\workspace\open\src\hotspot\share\code\aotCodeCache.cpp:2231), pid=101344, tid=56920
# assert(false) failed: Address 0x00007fff3f888e50 for runtime target 'ZPointerVectorLoadBadMask+0' is missing in AOT Code Cache addresses table
#
and an other:
[2026-01-24T01:09:28,841Z] # assert(false) failed: Address 0x0000ffffb50272ec for runtime target 'ZBarrierSetRuntime::store_barrier_on_oop_field_without_healing(oop*)+0' is missing in AOT Code Cache addresses table
I did not list all.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/28433#issuecomment-3800876793
More information about the hotspot-dev
mailing list