RFR: 8354887: Preserve runtime blobs in AOT code cache

Vladimir Kozlov kvn at openjdk.org
Sat May 3 23:35:45 UTC 2025


On Sat, 3 May 2025 04:10:01 GMT, Ashutosh Mehra <asmehra at openjdk.org> wrote:

> [8350209](https://bugs.openjdk.org/browse/JDK-8350209) introduced the framework for storing code in aot code cache and used it for caching i2c/c2i adapters.
> This PR extends the `AOTCodeCache` infrastructure and stores various runtime blobs (shared blobs, C1 and C2 runtime blobs) in the AOT code cache. It adds a new diagnostic flag `AOTStubCaching` to enable/disable the caching of these blobs.
> `AOTCodeFlags.java` test is extended to cover `AOTStubCaching`.

We need to do something about Compressed Klass base:

java -XX:AOTCache=app.aotcache -XX:+UnlockDiagnosticVMOptions -XX:+AOTAdapterCaching -XX:+AOTStubCaching -Xlog:aot+codecache+init=debug -cp hello.jar HelloWorld
[0.009s][debug][aot,codecache,init] Mapped 548864 bytes at address 0x00007f17b1611000 at AOT Code Cache
[0.009s][info ][aot,codecache,init] Loaded 384 AOT code entries from AOT Code Cache
[0.009s][debug][aot,codecache,init]   Adapters:  total=316
[0.009s][debug][aot,codecache,init]   Shared Blobs: total=14
[0.009s][debug][aot,codecache,init]   C1 Blobs: total=34
[0.009s][debug][aot,codecache,init]   C2 Blobs: total=20
[0.009s][debug][aot,codecache,init]   AOT code cache size: 543392 bytes
[0.009s][debug][aot,codecache,init]   Loaded 1 C strings of total length 28 at offset 521860 from AOT Code Cache
[0.010s][debug][aot,codecache,init] AOT Code Cache disabled: it was created with CompressedKlassPointers::base() = 0x7f56c6000000 vs current 0x7f1762000000
[0.010s][info ][aot,codecache,init] Unable to use AOT Code Cache.
Hellow World!

Which blob/stubs decompress/compress klass using the base?

May be we should use Relocation for it.

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

PR Comment: https://git.openjdk.org/jdk/pull/25019#issuecomment-2848857110
PR Comment: https://git.openjdk.org/jdk/pull/25019#issuecomment-2848857305
PR Comment: https://git.openjdk.org/jdk/pull/25019#issuecomment-2848857738


More information about the hotspot-runtime-dev mailing list