RFR: 8316694: Implement relocation of nmethod within CodeCache [v32]

Chad Rakoczy duke at openjdk.org
Wed Jul 2 20:50:51 UTC 2025


On Tue, 1 Jul 2025 11:24:09 GMT, Evgeny Astigeevich <eastigeevich at openjdk.org> wrote:

>> Chad Rakoczy has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 90 commits:
>> 
>>  - Merge remote-tracking branch 'origin/master' into JDK-8316694-Final
>>  - Update how call sites are fixed
>>  - Merge remote-tracking branch 'origin/master' into JDK-8316694-Final
>>  - Fix pointer printing
>>  - Use set_destination_mt_safe
>>  - Print address as pointer
>>  - Use new _metadata_size instead of _jvmci_data_size
>>  - Merge remote-tracking branch 'origin/master' into JDK-8316694-Final
>>  - Only check branch distance for aarch64 and riscv
>>  - Move far branch fix to fix_relocation_after_move
>>  - ... and 80 more: https://git.openjdk.org/jdk/compare/f799cf18...70e4164e
>
> src/hotspot/share/code/nmethod.cpp line 1653:
> 
>> 1651:       }
>> 1652:     }
>> 1653:   }
> 
> Do we need this code? Shouldn't missing trampolined be caught during fixing call sites?

If fixing call sites fails (like in the event of a missing trampoline) an assert will fail and the JVM will crash. I suppose it could be updated to abandon the relocation if that happens but that would require `fix_relocation_after_move` to return if it succeeded and proper handling by the caller.

> test/hotspot/jtreg/vmTestbase/nsk/jvmti/NMethodRelocation/nmethodrelocation.java line 37:
> 
>> 35: import jdk.test.whitebox.code.BlobType;
>> 36: 
>> 37: public class nmethodrelocation extends DebugeeClass {
> 
> Why is the class name not following the Java code conventions?

I was following the naming conventions of other JVMTI tests.
https://github.com/openjdk/jdk/tree/master/test/hotspot/jtreg/vmTestbase/nsk/jvmti

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23573#discussion_r2180937766
PR Review Comment: https://git.openjdk.org/jdk/pull/23573#discussion_r2180943465


More information about the hotspot-compiler-dev mailing list