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

Ashutosh Mehra asmehra at openjdk.org
Mon May 5 21:13:25 UTC 2025


On Sat, 3 May 2025 17:34:38 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Ashutosh Mehra has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 11 commits:
>> 
>>  - Merge branch 'master' into preserve-runtime-blobs-master
>>  - Address Vladimir's comments
>>    
>>    Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>>  - Remove irrelevant comment
>>    
>>    Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>>  - Fix win64 compile failures
>>    
>>    Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>>  - Fix AOTCodeFlags.java test
>>    
>>    Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>>  - Fix compile failure in minimal config
>>    
>>    Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>>  - Revert back changes that added AOTRuntimeConstants.
>>    Ensure CompressedOops::base and CompressedKlssPointers::base does not
>>    change in production run
>>    
>>    Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>>  - Fix merge conflicts
>>    
>>    Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>>  - Store/load AsmRemarks and DbgStrings in aot code cache
>>    
>>    Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>>  - Add missing external address in aarch64
>>    
>>    Signed-off-by: Ashutosh Mehra <asmehra at redhat.com>
>>  - ... and 1 more: https://git.openjdk.org/jdk/compare/2a4f37cc...ba612dab
>
> src/hotspot/share/code/aotCodeCache.cpp line 1119:
> 
>> 1117:     uint n = write_bytes(&offset, sizeof(uint));
>> 1118:     if (n != sizeof(uint)) {
>> 1119:       return false;
> 
> Consider using `id_for_C_string()`  and record ID instead of coping string. These strings should be recorded in C strings table already.
> If `id_for_C_string()` does not find - assert. We should add `add_C_string()` in missing place.

The asm remarks and dbg strings are not currently recorded in C string table.
I tried to add these strings by calling `AOTCodeCache::add_C_string()`  in `AsmRemarkCollection::insert()` but this results in adding LOTS of strings. So I add the strings to the string table only when writing the asm remarks. This keeps the string count in check.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/25019#discussion_r2074200389


More information about the hotspot-runtime-dev mailing list