RFR: 8364929: Assign unique id to each AdapterBlob stored in AOTCodeCache [v3]
Vladimir Kozlov
kvn at openjdk.org
Tue Sep 30 22:57:08 UTC 2025
On Tue, 30 Sep 2025 21:32:40 GMT, Ashutosh Mehra <asmehra at openjdk.org> wrote:
>> This patch assigns unique id to each AdapterHandlerEntry so as to avoid using hash computed from AdapterFingerPrint which may not be unique. Unique id allows AOTCodeCache to locate the AdapterBlob being requested to be loaded.
>>
>> Testing:
>> Before this patch `runtime/cds/appcds/aotClassLinking/StringConcatStress.java` emits warning messages in the production run:
>>
>> [0.009s][warning][aot,codecache,stubs] Saved blob's name 'LIIDIIIDL' is different from the expected name 'LIIDIIDL'
>> [0.009s][warning][aot ] Failed to link AdapterHandlerEntry (fp=LIIDIIDL) to its code in the AOT code cache
>> [0.009s][warning][aot,codecache,stubs] Saved blob's name 'IILLLLIIIIII' is different from the expected name 'IILLLLLILIII'
>> [0.009s][warning][aot ] Failed to link AdapterHandlerEntry (fp=IILLLLLILIII) to its code in the AOT code cache
>>
>> With this patch, such warnings are not seen at all
>
> Ashutosh Mehra has updated the pull request incrementally with one additional commit since the last revision:
>
> Add assert for _id_counter == 0
>
> Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
src/hotspot/share/runtime/sharedRuntime.cpp line 2608:
> 2606: // id_counter overflow
> 2607: return nullptr;
> 2608: }
I think it will cause issue with `ubsan` because we don't check for `nullptr` returned from this method.
May be use `guarantee(id > 0);` instead ?
2^32 -1 is big number. We can't have so much method's signatures combinations.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27553#discussion_r2393009381
More information about the hotspot-dev
mailing list