RFR: 8354887: Preserve runtime blobs in AOT code cache [v2]

Andrew Dinn adinn at openjdk.org
Wed May 7 15:34:15 UTC 2025


On Wed, 7 May 2025 14:40:29 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>>> I suspect I missed porting a change from premain. @adinn @vnkozlov any idea what that could be?
>> 
>> @ashu-mehra Just to explain what is going on here:
>> 
>> This is a performance trick. When compressed oops base is null r12 (aka rheapbase) will have been initialized to zero so it can be used as a zero register. This allows, for example, a move instruction to employ a register operand immediate rather than include a 64 bit zero value in the instruction stream, which results in reduced code size. In this case the two moves are zeroing the current Java thread's frame anchor fields, last Java frame pc and sp, which are only set while the thread is in native.
>> 
>> This trick is fine when generated code is run in the same JVM but no use if the code is generated in a VM with zero compressed oops base then reloaded into a JVM where it is no longer null.
>> 
>> So, Vladimir's advice is to disable this trick when generating AOT code.
>
> @adinn Do you remember why we commented `UseCompatibleCompressedOops` setting?:
> https://github.com/openjdk/leyden/commit/478f86f9cd6df6b92c037c83d0540b9c5fe97e5c
> 
> It is still not enabled - how we are not crashing in premain?

@vnkozlov Ergonomics comes into play. It is set to true in cdsConfig.cpp if CacheDataStore != nullptr.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/25019#issuecomment-2859064405


More information about the hotspot-compiler-dev mailing list