-
Enhancement
-
Resolution: Fixed
-
P4
-
11, 17, 18, 19, 20
-
b12
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8310198 | 17.0.9-oracle | Tobias Hartmann | P4 | Resolved | Fixed | b01 |
JDK-8308898 | 17.0.8 | Aleksey Shipilev | P4 | Resolved | Fixed | b05 |
JDK-8318520 | 11.0.22-oracle | Tobias Hartmann | P4 | Resolved | Fixed | b04 |
JDK-8316059 | 11.0.22 | Fei Yang | P4 | Resolved | Fixed | b01 |
```
JavaThread state: _thread_blocked
at jdk.internal.misc.Unsafe.allocateInstance(java.base@20-internal/Native Method)
at java.lang.invoke.DirectMethodHandle.allocateInstance(java.base@20-internal/DirectMethodHandle.java:501)
at java.lang.invoke.DirectMethodHandle$Holder.newInvokeSpecial(java.base@20-internal/DirectMethodHandle$Holder)
at java.lang.invoke.Invokers$Holder.linkToTargetMethod(java.base@20-internal/Invokers$Holder)
at VarHandleBaseTest$Handles.get(VarHandleBaseTest.java:377)
at VarHandleBaseTest$Handles.get(VarHandleBaseTest.java:372)
at VarHandleTestMethodHandleAccessInt.testArray(VarHandleTestMethodHandleAccessInt.java:985)
```
After walking through the VM code, I believe
http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/abf45dd6ae7c#l5.215
The original block was:
http://hg.openjdk.java.net/jdk9/jdk9/hotspot/rev/abf45dd6ae7c#l10.298
The intrinsic is currently only implemented in C2. I see no reason for this intrinsic to depend on `UseUnalignedAccesses`: what `LibraryCallKit::inline_unsafe_allocate()` does seems similar to what the regular `Parse::do_new()` does, namely doing the clinit barrier and then delegating into `GraphKit::new_instance`.
Most platforms enable `UseUnalignedAccesses`, so they are not affected by this. Two notable exceptions being ARM32 and RISC-V.
This affects the `java.lang.invoke`-rich paths (e.g. `VarHandles`) that end up calling `Unsafe.allocateInstance`, and rely on intrinsification for reasonable performance.
- backported by
-
JDK-8308898 Unsafe.allocateInstance should be intrinsified without UseUnalignedAccesses
-
- Resolved
-
-
JDK-8310198 Unsafe.allocateInstance should be intrinsified without UseUnalignedAccesses
-
- Resolved
-
-
JDK-8316059 Unsafe.allocateInstance should be intrinsified without UseUnalignedAccesses
-
- Resolved
-
-
JDK-8318520 Unsafe.allocateInstance should be intrinsified without UseUnalignedAccesses
-
- Resolved
-
- relates to
-
JDK-8130832 Extend the WhiteBox API to provide information about the availability of compiler intrinsics
-
- Resolved
-
- links to
-
Commit openjdk/jdk11u-dev/0713dbb1
-
Commit openjdk/jdk17u-dev/0d2cc357
-
Commit openjdk/jdk/c0623972
-
Review openjdk/jdk11u-dev/2125
-
Review openjdk/jdk17u-dev/1389
-
Review openjdk/jdk/9970