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

Chad Rakoczy duke at openjdk.org
Tue May 27 18:52:58 UTC 2025


On Fri, 23 May 2025 17:11:48 GMT, Tom Rodriguez <never at openjdk.org> wrote:

> I'd like to clarify a bit what's actually done here. Some JVMCI compilation can have an associated instance of InstalledCode that has value written into it by hotspot that point at the nmethod* and the verified entry point. If the mirror object is reclaimed by the garbage collector before the nmethod dies, the mirror field will be cleared. Graal may read those fields but will never write them. JVMCI compilations initiated by the CompileBroker will never have an associated mirror. The mirror object is associated with the method at construction time and will never be changed. So it's not necessary to exclude all JVMCI compiled nmethods from this relocation, only ones which have a non-null mirror object.

Thanks for this clarification. I have updated it to only exclude nmethod with mirrors.

I want to confirm that is okay to pass false for `phatom_ref` in `get_nmethod_mirror`. We don't read or write to the mirror and only call that to see if one exists so I believe it should be okay. Another option is to add a function to return the mirror_index and that can be used as the check instead.

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

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


More information about the hotspot-compiler-dev mailing list