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

Andrew Dinn adinn at openjdk.org
Wed May 7 09:55:16 UTC 2025


On Wed, 7 May 2025 03:51:32 GMT, Ashutosh Mehra <asmehra 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.

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

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


More information about the hotspot-runtime-dev mailing list