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

Chad Rakoczy duke at openjdk.org
Thu Jul 24 19:11:11 UTC 2025


On Mon, 21 Jul 2025 22:29:22 GMT, Vladimir Kozlov <kvn at openjdk.org> wrote:

>> Chad Rakoczy has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Require caller to hold locks
>
> src/hotspot/share/code/codeBehaviours.cpp line 46:
> 
>> 44: bool DefaultICProtectionBehaviour::is_safe(nmethod* method) {
>> 45:   return SafepointSynchronize::is_at_safepoint() || CompiledIC_lock->owned_by_self() || method->is_not_installed();
>> 46: }
> 
> Can you rename `method` to `nm` as we call it in similar code in GCs?

This has been updated

> src/hotspot/share/code/nmethod.cpp line 1630:
> 
>> 1628:   if (!is_java_method()) {
>> 1629:     return false;
>> 1630:   }
> 
> This should be first check.

This has been fixed

> src/hotspot/share/code/nmethod.cpp line 2453:
> 
>> 2451:     // Free memory if this is the last nmethod referencing immutable data
>> 2452:     if (get_immutable_data_references_counter() == 1) {
>> 2453:       os::free(_immutable_data);
> 
> You should add assert(get_immutable_data_references_counter() > 0  before  `if (counter == 1)`
> and zero it when freed.

This has been fixed

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23573#discussion_r2229341201
PR Review Comment: https://git.openjdk.org/jdk/pull/23573#discussion_r2229345858
PR Review Comment: https://git.openjdk.org/jdk/pull/23573#discussion_r2229346439


More information about the hotspot-compiler-dev mailing list