RFR: 8279412: [JVMCI] failed speculations list must outlive any nmethod that refers to it
Doug Simon
dnsimon at openjdk.java.net
Mon Jan 3 22:10:30 UTC 2022
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.
-------------
Commit messages:
- add support for attaching a speculation log to HotSpotNmethod
Changes: https://git.openjdk.java.net/jdk/pull/6949/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=6949&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8279412
Stats: 41 lines in 2 files changed: 29 ins; 10 del; 2 mod
Patch: https://git.openjdk.java.net/jdk/pull/6949.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/6949/head:pull/6949
PR: https://git.openjdk.java.net/jdk/pull/6949
More information about the hotspot-compiler-dev
mailing list