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

Chad Rakoczy duke at openjdk.org
Wed May 28 22:35:01 UTC 2025


On Wed, 28 May 2025 22:22:29 GMT, Evgeny Astigeevich <eastigeevich at openjdk.org> wrote:

>> Chad Rakoczy has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add JVMCINMethodData::has_mirror()
>
> src/hotspot/share/code/nmethod.cpp line 1580:
> 
>> 1578:     nm_copy->method()->set_code(mh, nm_copy);
>> 1579:     make_not_used();
>> 1580:   }
> 
> If `nm_copy->method()->code() != this`, we will return the copy which points at a method owning another code. This might be useful. Or we might return a broken copy. 
> Should we allow this?

That's an interesting point. Now that I think about it I'm curious when `nm_copy->method()->code() != this` would actually happen. It's possible for nmethods that have been recompiled. In that situation though the first nmethod would have been marked as not used and would have failed the `is_relocatable` check in the first place.

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

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


More information about the hotspot-compiler-dev mailing list