RFR: 8279412: [JVMCI] failed speculations list must outlive any nmethod that refers to it
Vladimir Kozlov
kvn at openjdk.java.net
Mon Jan 3 23:26:16 UTC 2022
On Mon, 3 Jan 2022 21:58:25 GMT, Doug Simon <dnsimon at openjdk.org> wrote:
> This PR adds a strong reference from a `HotSpotNmethod` object to the non-empty `HotSpotSpeculationLog` used when compiling the nmethod. This ensures that a `HotSpotSpeculationLog` that [manages](https://github.com/openjdk/jdk/blob/739769c8fc4b496f08a92225a12d07414537b6c0/src/jdk.internal.vm.ci/share/classes/jdk.vm.ci.hotspot/src/jdk/vm/ci/hotspot/HotSpotSpeculationLog.java#L116) a failed speculation list (i.e., the native memory of the failed speculations list is freed after the `HotSpotSpeculationLog` is collected) lives at least as long as the nmethod. Without this guarantee, when the nmethod deopts, it may try add a failed speculation to an already freed list.
Okay.
-------------
Marked as reviewed by kvn (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/6949
More information about the hotspot-compiler-dev
mailing list