-
Enhancement
-
Resolution: Fixed
-
P4
-
11, 12
-
b19
-
aarch64
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8231029 | 11.0.6 | Roland Westrelin | P4 | Resolved | Fixed | b01 |
JDK-8260821 | openjdk8u292 | Andrew Hughes | P4 | Resolved | Fixed | b01 |
Andrew Haley said:
I notice that this works for simple volatile access, but it does not
work for read-modify write operations such as, say,
VarHandle.getAndAdd(), where the barrier instructions are not elided:
;; membar_release
0x000003ffa8b049b8: dmb ish
0x000003ffa8b049bc: add x10, x19, #0xc
0x000003ffa8b049c0: ldxr wscratch2, [x10]
0x000003ffa8b049c4: add wscratch1, wscratch2, #0x1
0x000003ffa8b049c8: stxr wscratch2, wscratch1, [x10]
0x000003ffa8b049cc: cbnz wscratch2, 0x000003ffa8b049c0
0x000003ffa8b049d0: sub w10, wscratch1, #0x1
;; membar_acquire
0x000003ffa8b049d4: dmb ishld ;*invokevirtual getAndAddInt {reexecute=0 rethrow=0 return_oop=0}
; - java.lang.invoke.VarHandleInts$FieldInstanceReadWrite::getAndAdd@19 (line 206)
; - java.lang.invoke.VarHandleGuards::guard_LI_I@33 (line 129)
; - Sync::run@42 (line 35)
I think we need to be consistent about how we handle these operations.
I notice that this works for simple volatile access, but it does not
work for read-modify write operations such as, say,
VarHandle.getAndAdd(), where the barrier instructions are not elided:
;; membar_release
0x000003ffa8b049b8: dmb ish
0x000003ffa8b049bc: add x10, x19, #0xc
0x000003ffa8b049c0: ldxr wscratch2, [x10]
0x000003ffa8b049c4: add wscratch1, wscratch2, #0x1
0x000003ffa8b049c8: stxr wscratch2, wscratch1, [x10]
0x000003ffa8b049cc: cbnz wscratch2, 0x000003ffa8b049c0
0x000003ffa8b049d0: sub w10, wscratch1, #0x1
;; membar_acquire
0x000003ffa8b049d4: dmb ishld ;*invokevirtual getAndAddInt {reexecute=0 rethrow=0 return_oop=0}
; - java.lang.invoke.VarHandleInts$FieldInstanceReadWrite::getAndAdd@19 (line 206)
; - java.lang.invoke.VarHandleGuards::guard_LI_I@33 (line 129)
; - Sync::run@42 (line 35)
I think we need to be consistent about how we handle these operations.
- backported by
-
JDK-8231029 Aarch64: elide barriers on all volatile operations
-
- Resolved
-
-
JDK-8260821 Aarch64: elide barriers on all volatile operations
-
- Resolved
-
- relates to
-
JDK-8257192 Integrate AArch64 JIT port into 8u
-
- Resolved
-