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

Chad Rakoczy duke at openjdk.org
Thu Aug 21 21:09:12 UTC 2025


On Thu, 21 Aug 2025 12:54:56 GMT, Erik Österlund <eosterlund 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 107 commits:
>> 
>>  - Merge remote-tracking branch 'origin/master' into JDK-8316694-Final
>>  - Lock nmethod::relocate behind experimental flag
>>  - Use CompiledICLocker instead of CompiledIC_lock
>>  - Fix spacing
>>  - Update NMethod.java with immutable data changes
>>  - Rename method to nm
>>  - Add assert before freeing immutable data
>>  - Reorder is_relocatable checks
>>  - Require caller to hold locks
>>  - Revert is_always_within_branch_range changes
>>  - ... and 97 more: https://git.openjdk.org/jdk/compare/9593730a...24c35689
>
> src/hotspot/share/gc/z/zUnload.cpp line 103:
> 
>> 101: 
>> 102:   virtual bool is_safe(nmethod* nm) {
>> 103:     if (SafepointSynchronize::is_at_safepoint() || nm->is_unloading() || nm->is_not_installed()) {
> 
> Why is this change needed?

We clear inline caches on the new nmethod (`nmethod::clear_inline_caches()`). `CompiledICProtectionBehaviour::is_safe` is used as a check to verify that the caches are safe to clear. If the nmethod is not installed nothing should be using the caches so it should be safe to clear

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

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


More information about the hotspot-compiler-dev mailing list