RFR: 8279412: [JVMCI] failed speculations list must outlive any nmethod that refers to it

Doug Simon dnsimon at openjdk.java.net
Tue Jan 4 09:18:17 UTC 2022


On Tue, 4 Jan 2022 01:09:30 GMT, Tom Rodriguez <never 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.
>
> Marked as reviewed by never (Reviewer).

Thanks for the reviews @tkrodriguez and @vnkozlov .

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

PR: https://git.openjdk.java.net/jdk/pull/6949


More information about the hotspot-compiler-dev mailing list