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

Chad Rakoczy duke at openjdk.org
Thu Jul 17 00:02:57 UTC 2025


On Wed, 16 Jul 2025 21:26:05 GMT, Dean Long <dlong at openjdk.org> wrote:

> But let's say another thread is trying to mark the source nmethod as not entrant while nmethod::relocate is running, or soon after. What is the desired outcome for the newly relocated nmethod? It seems like any call to make_not_entrant() on the source would also want to do the same on the copy, right?

You're correct I think the code is fine as is. If the source gets marked not entrant we can just mark the copy as not entrant as well. 

However I do think it is important to require the caller of `nmethod::relocate()` to hold the `CodeCache_lock` instead of acquiring the lock inside of `relocate()`. Otherwise the nmethod that is blocked on the lock could be purged from the code cache

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

PR Comment: https://git.openjdk.org/jdk/pull/23573#issuecomment-3081853751


More information about the hotspot-compiler-dev mailing list