Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8209835

Aarch64: elide barriers on all volatile operations

    XMLWordPrintable

Details

    • b19
    • aarch64

    Backports

      Description

        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.

        Attachments

          Issue Links

            Activity

              People

                roland Roland Westrelin
                roland Roland Westrelin
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: