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

Doug Simon dnsimon at openjdk.java.net
Tue Jan 4 10:18:17 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.

This pull request has now been integrated.

Changeset: 1ffdc52c
Author:    Doug Simon <dnsimon at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/1ffdc52cf0ab88458e0583bff28d35ca33d244b7
Stats:     41 lines in 2 files changed: 29 ins; 10 del; 2 mod

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

Reviewed-by: kvn, never

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

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


More information about the hotspot-compiler-dev mailing list