RFR: 8290234: [JVMCI] use JVMCIKlassHandle to protect raw Klass* values from concurrent G1 scanning

Doug Simon dnsimon at openjdk.org
Wed Jul 13 12:40:44 UTC 2022


JVMCI Java code must never read a raw `Klass*` value from memory (using `Unsafe`) that is not already known to be wrapped in a `HotSpotResolvedObjectTypeImpl` without going through a VM call. The VM call is necessary so that the `Klass*` is handlized in a `JVMCIKlassHandle` to protect it from the concurrent scanning done by G1. This PR re-introduces the VM calls that were mistakenly optimized away in [JDK-8289094](https://bugs.openjdk.org/browse/JDK-8289094).

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

Commit messages:
 - use JVMCIKlassHandle to protect raw Klass* values from concurrent G1 scanning

Changes: https://git.openjdk.org/jdk/pull/9480/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=9480&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8290234
  Stats: 21 lines in 3 files changed: 8 ins; 5 del; 8 mod
  Patch: https://git.openjdk.org/jdk/pull/9480.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9480/head:pull/9480

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


More information about the hotspot-compiler-dev mailing list