RFR: 8318940: [JVMCI] do not set HotSpotNmethod oop for a default HotSpotNmethod

Doug Simon dnsimon at openjdk.org
Thu Oct 26 22:13:41 UTC 2023


The code in `c2v_translate` for translating a `HotSpotNmethod` object from the libgraal heap to the HotSpot heap has a bug where it is setting the oop slot in an `nmethod` that ties the lifetime of the `HotSpotNmethod` object to the associated `nmethod`. Roughly speaking, when the `HotSpotNmethod` object becomes garbage, the `nmethod` is unloaded.

This relationship is only maintained for [non-default HotSpotNmethods](https://github.com/openjdk/jdk/blob/77fe0fd9e6f1e1f775a5191640411c37eb51b415/src/jdk.internal.vm.ci/share/classes/jdk/vm/ci/hotspot/HotSpotNmethod.java#L47-L54). For a default `HotSpotNmethod`, no such oop slot exists and so it must not be set. This PR makes that fix.

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

Commit messages:
 - do not set the HotSpotNmethod oop for a default HotSpotNmethod

Changes: https://git.openjdk.org/jdk/pull/16386/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16386&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8318940
  Stats: 6 lines in 2 files changed: 0 ins; 0 del; 6 mod
  Patch: https://git.openjdk.org/jdk/pull/16386.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16386/head:pull/16386

PR: https://git.openjdk.org/jdk/pull/16386


More information about the hotspot-compiler-dev mailing list