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

Chad Rakoczy duke at openjdk.org
Wed Jun 25 22:53:39 UTC 2025


On Mon, 23 Jun 2025 23:22:04 GMT, Dean Long <dlong at openjdk.org> wrote:

> The extra work that CallRelocation::fix_relocation_after_move and Relocation::pd_set_call_destination are now doing is only needed for nmethod relocation, right? We could avoid doing extra work for the old CodeBuffer::relocate_code_to() path by adding a flag to CallRelocation::fix_relocation_after_move() (or creating a new function) and then pass that flag on to pd_set_call_destination. In particular, it would be nice to avoid unnecessary calls to CodeCache::find_blob().

I think this is a good idea. Like you mentioned it is only needed for nmethod relocation so it does not make sense to alter the logic for other things that may call these functions. I added a flag so code path for `CodeBuffer::relocate_code_to()` should be unchanged

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

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


More information about the hotspot-compiler-dev mailing list