aarch64: C2 fast lock/unlock issues

Hui Shi hui.shi at linaro.org
Fri Aug 21 12:21:12 UTC 2015

Hi JIT members,

Attached fast_lock.patch fixes issues in fast lock/unlock on aarch64
platform (in both aarch64-jdk8 and jdk9/hs-comp/hotspot). Could someone
help comments, review or sponsor?
A small test case and  PrintAssembly log with/without fix are also attached
for reference.

To reproduce this issue on aarch64, command line is "java
-XX:-TieredCompilation -XX:+UnlockDiagnosticVMOptions
-XX:-BackgroundCompilation -XX:CompileCommand="compileonly,TestSync.f*"
-XX:+PrintAssembly  TestSync"

There are three Issues in aarch64 fast lock/unlock:
*1. Duplicated biased lock checking*
When option UseBiasedLocking and UseOptoBiasInlining are both true, it
doesn't need emit biased_locking_enter in aarch64_enc_fast_lock. This is
redundant as biased locking enter check is already inlined in
PhaseMacroExpand::expand_lock_node. Checking assembly code in orig.asm

[Inlined biased lock check in PhaseMacroExpand::expand_lock_node]
  0x000003ff88320d94: str       x1, [sp]
  0x000003ff88320d98: ldr       x10, [x1]
  0x000003ff88320d9c: and       x11, x10, #0x7
  0x000003ff88320da0: cmp       x11, #0x5
  0x000003ff88320da4: b.ne      0x000003ff88320e18

[Biased lock check expanded in aarch64_enc_fast_lock]
  0x000003ff88320e18: add       x12, sp, #0x10
  0x000003ff88320e1c: ldr       x10, [x1]
  0x000003ff88320e20: and       x11, x12, #0x7
  0x000003ff88320e24: cmp       x11, #0x5
  0x000003ff88320e28: b.ne      0x000003ff88320eec

*2. Incorrect parameter used in biased_locking_enter in
Checking above code [Biased lock check expanded in aarch64_enc_fast_lock],
x12 is the box register and holding the address of the lock record on
stack. However it is mis-used as mark word in biased lock checking here. As
a result, biased pattern check always fails because stack pointer is 8
bytes align and x11 must be zero.

Current implementation in aarch64_enc_fast_lock.
      *biased_locking_enter(disp_hdr, oop, box, tmp, true, cont);*
Which should be
      *biased_locking_enter(box, oop, disp_hdr, tmp, true, cont);  //swap
disp_hdr and box register, disp_hdr is already loaded with object mark word*

This issue might cause problem when running with option
-XX:-UseOptoBiasInlining in following scenario, let’s check above code in
[Biased lock check expanded in aarch64_enc_fast_lock], x12 is box and x10
is disp_hdr.
1. Suppose object’s mark word (loaded into register x10) is in biased mode,
with content “[biased_thread |epoch|age| 101]” and biased_thread is
executing its synchronized block.
2. Another thread tries to acquire the same lock. Firstly, it performs
biased pattern check and fails, because “mark word” register used here is
X12 (correct register should be x10).
3. As x12 is not “biased” (least three significant bits of SP + 0x10 would
never be 101),  execution goes to thin lock CAS acquire code instead of
biased lock revoke/rebias code.
4. Thin lock CAS acquire will succeed because x10’s least two significant
bit is 01 (thin lock CAS code uses disp_hdr (x10) as mark word). Two
threads acquire same lock at same time and this is incorrect behavior.

*3. Inflate monitor code has typo in aarch64_enc_fast_lock*
Inflated lock test is generated under condition (EmitSync & 0x02), while
generating inflated lock fast path under condition "if ((EmitSync & 0x02)
== 0))". At both location, they should be "if ((EmitSync & 0x02) == 0) ".
In orig.asm, no instruction branches to inflated lock acquire fast path at

Issue #1 and #3 does not impact correctness, they introduce redundant code
(double biased lock check) and skip inflated lock fast path check (_owner
is null case).
Fix is in aarch64_enc_fast_lock/aarch64_enc_fast_unlock, this will not
impact C1 and interpreter. Attached patch includes:
1. Disable generating biased lock handle code in fast_lock/fast_unlock when
UseOptoBiasInlining is true.
2. Adjust biased_locking_enter’s actual parameters, swap disp_hdr and box
3. Fix typo in inflated monitor handling.

Shi Hui
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20150821/a9980f0f/attachment-0001.html>
-------------- next part --------------
[Disassembling for mach='aarch64']
[Entry Point]
[Verified Entry Point]
  # {method} {0x0000007f1264b4e8} 'foo' '(LTestSync;)I' in 'TestSync'
  # parm0:    c_rarg1:c_rarg1 
                        = 'TestSync'
  #           [sp+0x30]  (sp of caller)
  0x0000007f950e8000: nop
  0x0000007f950e8004: orr       x9, xzr, #0xffffffffffffc000
  0x0000007f950e8008: str       xzr, [sp,x9]
  0x0000007f950e800c: sub       sp, sp, #0x30
  0x0000007f950e8010: stp       x29, x30, [sp,#32]  ;*synchronization entry
                                                ; - TestSync::foo at -1 (line 27)

  0x0000007f950e8014: str       x1, [sp]
  0x0000007f950e8018: ldr       x10, [x1]       ; implicit exception: dispatches to 0x0000007f950e81e4
  0x0000007f950e801c: and       x11, x10, #0x7
  0x0000007f950e8020: cmp       x11, #0x5
  0x0000007f950e8024: b.ne      0x0000007f950e8098
  0x0000007f950e8028: mov       x11, #0x60000                   // #393216
                                                ;   {metadata('TestSync')}
  0x0000007f950e802c: movk      x11, #0x28
  0x0000007f950e8030: eor       x11, x11, #0x800000000
  0x0000007f950e8034: ldr       x11, [x11,#168]
  0x0000007f950e8038: mov       x12, x28
  0x0000007f950e803c: orr       x12, x12, x11
  0x0000007f950e8040: eor       x13, x12, x10
  0x0000007f950e8044: and       x14, x13, #0xffffffffffffff87
  0x0000007f950e8048: cbnz      x14, 0x0000007f950e819c
  0x0000007f950e804c: dmb       ishld           ;*synchronization entry
                                                ; - TestSync::fgetQuantity at -1 (line 5)
                                                ; - TestSync::foo at 1 (line 27)

  0x0000007f950e8050: ldr       x10, [sp]
  0x0000007f950e8054: ldrsh     w20, [x10,#12]  ;*getfield quantity
                                                ; - TestSync::fgetQuantity at 1 (line 5)
                                                ; - TestSync::foo at 1 (line 27)

  0x0000007f950e8058: dmb       ish
  0x0000007f950e805c: ldr       x10, [x10]
  0x0000007f950e8060: and       x10, x10, #0x7
  0x0000007f950e8064: cmp       x10, #0x5
  0x0000007f950e8068: b.ne      0x0000007f950e810c  ;*ireturn
                                                ; - TestSync::fgetQuantity at 6 (line 6)
                                                ; - TestSync::foo at 1 (line 27)

  0x0000007f950e806c: mov       w0, w20
  0x0000007f950e8070: ldp       x29, x30, [sp,#32]
  0x0000007f950e8074: add       sp, sp, #0x30
  0x0000007f950e8078: adrp      x8, 0x0000007f9e847000
                                                ;   {poll_return}
  0x0000007f950e807c: ldr       wzr, [x8]       ;   {poll_return}
  0x0000007f950e8080: ret
  0x0000007f950e8084: ldxr      x8, [x1]
  0x0000007f950e8088: cmp       x8, x10
  0x0000007f950e808c: b.ne      0x0000007f950e8098
  0x0000007f950e8090: stlxr     w8, x11, [x1]
  0x0000007f950e8094: cbnz      w8, 0x0000007f950e8084
  0x0000007f950e8098: add       x12, sp, #0x10
  0x0000007f950e809c: ldr       x10, [x1]
  0x0000007f950e80a0: tbnz      w10, #1, 0x0000007f950e80dc
  0x0000007f950e80a4: orr       x10, x10, #0x1
  0x0000007f950e80a8: str       x10, [x12]
  0x0000007f950e80ac: ldxr      x11, [x1]
  0x0000007f950e80b0: cmp       x11, x10
  0x0000007f950e80b4: b.ne      0x0000007f950e80c4
  0x0000007f950e80b8: stlxr     w11, x12, [x1]
  0x0000007f950e80bc: cbz       w11, 0x0000007f950e80fc
  0x0000007f950e80c0: b 0x0000007f950e80ac
  0x0000007f950e80c4: mov       x8, sp
  0x0000007f950e80c8: sub       x10, x10, x8
  0x0000007f950e80cc: orr       x11, xzr, #0xfffffffffffff003
  0x0000007f950e80d0: ands      x11, x10, x11
  0x0000007f950e80d4: str       x11, [x12]
  0x0000007f950e80d8: b 0x0000007f950e80fc
  0x0000007f950e80dc: add       x11, x10, #0x16
  0x0000007f950e80e0: mov       x10, xzr
  0x0000007f950e80e4: ldxr      x8, [x11]
  0x0000007f950e80e8: cmp       x10, x8
  0x0000007f950e80ec: b.ne      0x0000007f950e80f8
  0x0000007f950e80f0: stlxr     w8, x28, [x11]
  0x0000007f950e80f4: cbnz      w8, 0x0000007f950e80e4
  0x0000007f950e80f8: str       x12, [x12]
  0x0000007f950e80fc: b.eq      0x0000007f950e804c
  0x0000007f950e8100: add       x2, sp, #0x10
  0x0000007f950e8104: bl        0x0000007f950dcb40  ; OopMap{[0]=Oop off=264}
                                                ;*synchronization entry
                                                ; - TestSync::fgetQuantity at -1 (line 5)
                                                ; - TestSync::foo at 1 (line 27)
                                                ;   {runtime_call}
  0x0000007f950e8108: b 0x0000007f950e804c
  0x0000007f950e810c: add       x12, sp, #0x10
  0x0000007f950e8110: ldr       x13, [sp]
  0x0000007f950e8114: ldr       x11, [x12]
  0x0000007f950e8118: cmp       x11, xzr
  0x0000007f950e811c: b.eq      0x0000007f950e817c
  0x0000007f950e8120: ldr       x10, [x13]
  0x0000007f950e8124: tbnz      w11, #1, 0x0000007f950e8144
  0x0000007f950e8128: ldxr      x10, [x13]
  0x0000007f950e812c: cmp       x12, x10
  0x0000007f950e8130: b.ne      0x0000007f950e8140
  0x0000007f950e8134: stlxr     w10, x11, [x13]
  0x0000007f950e8138: cbz       w10, 0x0000007f950e817c
  0x0000007f950e813c: b 0x0000007f950e8128
  0x0000007f950e8140: b 0x0000007f950e817c
  0x0000007f950e8144: sub       x10, x10, #0x2
  0x0000007f950e8148: ldr       x8, [x10,#24]
  0x0000007f950e814c: ldr       x11, [x10,#40]
  0x0000007f950e8150: eor       x8, x8, x28
  0x0000007f950e8154: orr       x8, x8, x11
  0x0000007f950e8158: cmp       x8, xzr
  0x0000007f950e815c: b.ne      0x0000007f950e817c
  0x0000007f950e8160: ldr       x8, [x10,#64]
  0x0000007f950e8164: ldr       x11, [x10,#56]
  0x0000007f950e8168: orr       x8, x8, x11
  0x0000007f950e816c: cmp       x8, xzr
  0x0000007f950e8170: b.ne      0x0000007f950e817c
  0x0000007f950e8174: add       x10, x10, #0x18
  0x0000007f950e8178: stlr      x8, [x10]
  0x0000007f950e817c: b.eq      0x0000007f950e806c
  0x0000007f950e8180: add       x1, sp, #0x10   ;*synchronization entry
                                                ; - TestSync::fgetQuantity at -1 (line 5)
                                                ; - TestSync::foo at 1 (line 27)

  0x0000007f950e8184: mov       x0, x13
  0x0000007f950e8188: mov       x8, #0xebbc                     // #60348
                                                ;   {runtime_call}
  0x0000007f950e818c: movk      x8, #0x9e35, lsl #16
  0x0000007f950e8190: movk      x8, #0x7f, lsl #32
  0x0000007f950e8194: blr       x8              ;*ireturn
                                                ; - TestSync::fgetQuantity at 6 (line 6)
                                                ; - TestSync::foo at 1 (line 27)

  0x0000007f950e8198: b 0x0000007f950e806c
  0x0000007f950e819c: and       x14, x13, #0x7
  0x0000007f950e81a0: cbnz      x14, 0x0000007f950e8084
  0x0000007f950e81a4: mov       x14, #0x37f                     // #895
  0x0000007f950e81a8: and       x14, x10, x14
  0x0000007f950e81ac: mov       x11, x28
  0x0000007f950e81b0: and       x13, x13, #0x300
  0x0000007f950e81b4: orr       x11, x11, x14
  0x0000007f950e81b8: cbnz      x13, 0x0000007f950e81d8
  0x0000007f950e81bc: ldxr      x8, [x1]
  0x0000007f950e81c0: cmp       x8, x14
  0x0000007f950e81c4: b.ne      0x0000007f950e81d0
  0x0000007f950e81c8: stlxr     w8, x11, [x1]
  0x0000007f950e81cc: cbnz      w8, 0x0000007f950e81bc
  0x0000007f950e81d0: b.ne      0x0000007f950e8100
  0x0000007f950e81d4: b 0x0000007f950e804c
  0x0000007f950e81d8: mov       x11, x12
  0x0000007f950e81dc: mov       x14, x10
  0x0000007f950e81e0: b 0x0000007f950e81bc
  0x0000007f950e81e4: mov       w1, #0xfffffff6                 // #-10
  0x0000007f950e81e8: bl        0x0000007f9507efc0  ; OopMap{off=492}
                                                ;*invokevirtual fgetQuantity
                                                ; - TestSync::foo at 1 (line 27)
                                                ;   {runtime_call}
  0x0000007f950e81ec: brk       #0x3e7          ;*invokevirtual fgetQuantity
                                                ; - TestSync::foo at 1 (line 27)

  0x0000007f950e81f0: .inst     0x00000000 ; undefined
  0x0000007f950e81f4: .inst     0x00000000 ; undefined
  0x0000007f950e81f8: .inst     0x00000000 ; undefined
  0x0000007f950e81fc: .inst     0x00000000 ; undefined
[Exception Handler]
[Stub Code]
  0x0000007f950e8200: b 0x0000007f950d9b80      ;   {no_reloc}
[Deopt Handler Code]
  0x0000007f950e8204: adr       x30, 0x0000007f950e8204
  0x0000007f950e8208: b 0x0000007f950b35c0      ;   {runtime_call}
  0x0000007f950e820c: .inst     0x00000000 ; undefined
-------------- next part --------------
A non-text attachment was scrubbed...
Name: fast_lock.patch
Type: application/octet-stream
Size: 949 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20150821/a9980f0f/fast_lock-0001.patch>
-------------- next part --------------
[Entry Point]
[Verified Entry Point]
  # {method} {0x0000007f818004e8} 'foo' '(LTestSync;)I' in 'TestSync'
  # parm0:    c_rarg1:c_rarg1
                        = 'TestSync'
  #           [sp+0x30]  (sp of caller)
  0x0000007f9c3ad480: nop
  0x0000007f9c3ad484: orr       x9, xzr, #0xffffffffffffc000
  0x0000007f9c3ad488: str       xzr, [sp,x9]
  0x0000007f9c3ad48c: sub       sp, sp, #0x30
  0x0000007f9c3ad490: stp       x29, x30, [sp,#32]  ;*synchronization entry
                                                ; - TestSync::foo at -1 (line 31)

  0x0000007f9c3ad494: str       x1, [sp]
  0x0000007f9c3ad498: cbz       x1, 0x0000007f9c3ad680
                                                ;*invokevirtual fgetQuantity
                                                ; - TestSync::foo at 1 (line 31)

  0x0000007f9c3ad49c: add       x12, sp, #0x10
  0x0000007f9c3ad4a0: ldr       x10, [x1]
  0x0000007f9c3ad4a4: and       x11, x10, #0x7
  0x0000007f9c3ad4a8: cmp       x11, #0x5
  0x0000007f9c3ad4ac: b.ne      0x0000007f9c3ad570
  0x0000007f9c3ad4b0: ldr       w11, [x1,#8]
  0x0000007f9c3ad4b4: eor       x11, x11, #0x800000000
  0x0000007f9c3ad4b8: ldr       x11, [x11,#168]
  0x0000007f9c3ad4bc: orr       x11, x11, x28
  0x0000007f9c3ad4c0: eor       x11, x10, x11
  0x0000007f9c3ad4c4: and       x11, x11, #0xffffffffffffff87
  0x0000007f9c3ad4c8: cbz       x11, 0x0000007f9c3ad5d0
  0x0000007f9c3ad4cc: and       x8, x11, #0x7
  0x0000007f9c3ad4d0: cbnz      x8, 0x0000007f9c3ad540
  0x0000007f9c3ad4d4: and       x8, x11, #0x300
  0x0000007f9c3ad4d8: cbnz      x8, 0x0000007f9c3ad50c
  0x0000007f9c3ad4dc: mov       x8, #0x37f                      // #895
  0x0000007f9c3ad4e0: and       x10, x10, x8
  0x0000007f9c3ad4e4: orr       x11, x10, x28
  0x0000007f9c3ad4e8: ldaxr     x8, [x1]
  0x0000007f9c3ad4ec: cmp       x8, x10
  0x0000007f9c3ad4f0: b.ne      0x0000007f9c3ad500
  0x0000007f9c3ad4f4: stlxr     w8, x11, [x1]
  0x0000007f9c3ad4f8: cbz       w8, 0x0000007f9c3ad508
  0x0000007f9c3ad4fc: b 0x0000007f9c3ad4e8
  0x0000007f9c3ad500: dmb       ish
  0x0000007f9c3ad504: mov       x10, x8
  0x0000007f9c3ad508: b 0x0000007f9c3ad5d0
  0x0000007f9c3ad50c: ldr       w11, [x1,#8]
  0x0000007f9c3ad510: eor       x11, x11, #0x800000000
  0x0000007f9c3ad514: ldr       x11, [x11,#168]
  0x0000007f9c3ad518: orr       x11, x28, x11
  0x0000007f9c3ad51c: ldaxr     x8, [x1]
  0x0000007f9c3ad520: cmp       x8, x10
  0x0000007f9c3ad524: b.ne      0x0000007f9c3ad534
  0x0000007f9c3ad528: stlxr     w8, x11, [x1]
  0x0000007f9c3ad52c: cbz       w8, 0x0000007f9c3ad53c
  0x0000007f9c3ad530: b 0x0000007f9c3ad51c
  0x0000007f9c3ad534: dmb       ish
  0x0000007f9c3ad538: mov       x10, x8
  0x0000007f9c3ad53c: b 0x0000007f9c3ad5d0
  0x0000007f9c3ad540: ldr       w11, [x1,#8]
  0x0000007f9c3ad544: eor       x11, x11, #0x800000000
  0x0000007f9c3ad548: ldr       x11, [x11,#168]
  0x0000007f9c3ad54c: ldaxr     x8, [x1]
  0x0000007f9c3ad550: cmp       x8, x10
  0x0000007f9c3ad554: b.ne      0x0000007f9c3ad564
  0x0000007f9c3ad558: stlxr     w8, x11, [x1]
  0x0000007f9c3ad55c: cbz       w8, 0x0000007f9c3ad570
  0x0000007f9c3ad560: b 0x0000007f9c3ad54c
  0x0000007f9c3ad564: dmb       ish
  0x0000007f9c3ad568: mov       x10, x8
  0x0000007f9c3ad56c: b 0x0000007f9c3ad570
  0x0000007f9c3ad570: ldr       x10, [x1]
  0x0000007f9c3ad574: tbnz      w10, #1, 0x0000007f9c3ad5b0
  0x0000007f9c3ad578: orr       x10, x10, #0x1
  0x0000007f9c3ad57c: str       x10, [x12]
  0x0000007f9c3ad580: ldxr      x11, [x1]
  0x0000007f9c3ad584: cmp       x11, x10
  0x0000007f9c3ad588: b.ne      0x0000007f9c3ad598
  0x0000007f9c3ad58c: stlxr     w11, x12, [x1]
  0x0000007f9c3ad590: cbz       w11, 0x0000007f9c3ad5d0
  0x0000007f9c3ad594: b 0x0000007f9c3ad580
  0x0000007f9c3ad598: mov       x8, sp
  0x0000007f9c3ad59c: sub       x10, x10, x8
  0x0000007f9c3ad5a0: orr       x11, xzr, #0xfffffffffffff003
  0x0000007f9c3ad5a4: ands      x11, x10, x11
  0x0000007f9c3ad5a8: str       x11, [x12]
  0x0000007f9c3ad5ac: b 0x0000007f9c3ad5d0
  0x0000007f9c3ad5b0: add       x11, x10, #0x16
  0x0000007f9c3ad5b4: mov       x10, xzr
  0x0000007f9c3ad5b8: ldxr      x8, [x11]
  0x0000007f9c3ad5bc: cmp       x10, x8
  0x0000007f9c3ad5c0: b.ne      0x0000007f9c3ad5cc
  0x0000007f9c3ad5c4: stlxr     w8, x28, [x11]
  0x0000007f9c3ad5c8: cbnz      w8, 0x0000007f9c3ad5b8
  0x0000007f9c3ad5cc: str       x12, [x12]
  0x0000007f9c3ad5d0: b.ne      0x0000007f9c3ad68c
  0x0000007f9c3ad5d4: dmb       ishld           ;*synchronization entry
                                                ; - TestSync::fgetQuantity at -1 (line 6)
                                                ; - TestSync::foo at 1 (line 31)

  0x0000007f9c3ad5d8: ldr       x10, [sp]
  0x0000007f9c3ad5dc: ldrsh     w19, [x10,#12]  ;*getfield quantity
                                                ; - TestSync::fgetQuantity at 1 (line 6)
                                                ; - TestSync::foo at 1 (line 31)
  0x0000007f9c3ad5e0: dmb       ish             ;*ireturn
                                                ; - TestSync::fgetQuantity at 6 (line 7)
                                                ; - TestSync::foo at 1 (line 31)

  0x0000007f9c3ad5e4: add       x12, sp, #0x10  ;*synchronization entry
                                                ; - TestSync::fgetQuantity at -1 (line 6)
                                                ; - TestSync::foo at 1 (line 31)

  0x0000007f9c3ad5e8: ldr       x13, [sp]
  0x0000007f9c3ad5ec: ldr       x10, [x13]
  0x0000007f9c3ad5f0: and       x10, x10, #0x7
  0x0000007f9c3ad5f4: cmp       x10, #0x5
  0x0000007f9c3ad5f8: b.eq      0x0000007f9c3ad664
  0x0000007f9c3ad5fc: ldr       x11, [x12]
  0x0000007f9c3ad600: cmp       x11, xzr
  0x0000007f9c3ad604: b.eq      0x0000007f9c3ad664
  0x0000007f9c3ad608: ldr       x10, [x13]
  0x0000007f9c3ad60c: tbnz      w11, #1, 0x0000007f9c3ad62c
  0x0000007f9c3ad610: ldxr      x10, [x13]
  0x0000007f9c3ad614: cmp       x12, x10
  0x0000007f9c3ad618: b.ne      0x0000007f9c3ad628
  0x0000007f9c3ad61c: stlxr     w10, x11, [x13]
  0x0000007f9c3ad620: cbz       w10, 0x0000007f9c3ad664
  0x0000007f9c3ad624: b 0x0000007f9c3ad610
  0x0000007f9c3ad628: b 0x0000007f9c3ad664
  0x0000007f9c3ad62c: sub       x10, x10, #0x2
  0x0000007f9c3ad630: ldr       x8, [x10,#24]
  0x0000007f9c3ad634: ldr       x11, [x10,#40]
  0x0000007f9c3ad638: eor       x8, x8, x28
  0x0000007f9c3ad63c: orr       x8, x8, x11
  0x0000007f9c3ad640: cmp       x8, xzr
  0x0000007f9c3ad644: b.ne      0x0000007f9c3ad664
  0x0000007f9c3ad648: ldr       x8, [x10,#64]
  0x0000007f9c3ad64c: ldr       x11, [x10,#56]
  0x0000007f9c3ad650: orr       x8, x8, x11
  0x0000007f9c3ad654: cmp       x8, xzr
  0x0000007f9c3ad658: b.ne      0x0000007f9c3ad664
  0x0000007f9c3ad65c: add       x10, x10, #0x18
  0x0000007f9c3ad660: stlr      x8, [x10]
  0x0000007f9c3ad664: b.ne      0x0000007f9c3ad698  ;*ireturn
                                                ; - TestSync::fgetQuantity at 6 (line 7)
                                                ; - TestSync::foo at 1 (line 31)

  0x0000007f9c3ad668: mov       w0, w19
  0x0000007f9c3ad66c: ldp       x29, x30, [sp,#32]
  0x0000007f9c3ad670: add       sp, sp, #0x30
  0x0000007f9c3ad674: adrp      x8, 0x0000007fa9389000
                                                ;   {poll_return}
  0x0000007f9c3ad678: ldr       wzr, [x8]       ;   {poll_return}
  0x0000007f9c3ad67c: ret
  0x0000007f9c3ad680: mov       w1, #0xfffffff6                 // #-10
  0x0000007f9c3ad684: bl        0x0000007f9c07efc0  ; OopMap{off=520}
                                                ;*invokevirtual fgetQuantity
                                                ; - TestSync::foo at 1 (line 31)
                                                ;   {runtime_call}
  0x0000007f9c3ad688: brk       #0x3e7          ;*invokevirtual fgetQuantity
                                                ; - TestSync::foo at 1 (line 31)

  0x0000007f9c3ad68c: add       x2, sp, #0x10
  0x0000007f9c3ad690: bl        0x0000007f9c0dcb40  ; OopMap{[0]=Oop off=532}
                                                ;*synchronization entry
                                                ; - TestSync::fgetQuantity at -1 (line 6)
                                                ; - TestSync::foo at 1 (line 31)
                                                ;   {runtime_call}
  0x0000007f9c3ad694: b 0x0000007f9c3ad5d4
  0x0000007f9c3ad698: add       x1, sp, #0x10   ;*synchronization entry
                                                ; - TestSync::fgetQuantity at -1 (line 6)
                                                ; - TestSync::foo at 1 (line 31)

  0x0000007f9c3ad69c: mov       x0, x13
  0x0000007f9c3ad6a0: mov       x8, #0xbbc                      // #3004
                                                ;   {runtime_call}
  0x0000007f9c3ad6a4: movk      x8, #0xa8ea, lsl #16
  0x0000007f9c3ad6a8: movk      x8, #0x7f, lsl #32
  0x0000007f9c3ad6ac: blr       x8              ;*ireturn
                                                ; - TestSync::fgetQuantity at 6 (line 7)
                                                ; - TestSync::foo at 1 (line 31)

  0x0000007f9c3ad6b0: b 0x0000007f9c3ad668
  0x0000007f9c3ad6b4: .inst     0x00000000 ; undefined
  0x0000007f9c3ad6b8: .inst     0x00000000 ; undefined
  0x0000007f9c3ad6bc: .inst     0x00000000 ; undefined
[Exception Handler]
[Stub Code]
  0x0000007f9c3ad6c0: b 0x0000007f9c0d9b80      ;   {no_reloc}
[Deopt Handler Code]
  0x0000007f9c3ad6c4: adr       x30, 0x0000007f9c3ad6c4
  0x0000007f9c3ad6c8: b 0x0000007f9c0b35c0      ;   {runtime_call}
  0x0000007f9c3ad6cc: .inst     0x00000000 ; undefined
-------------- next part --------------
Decoding compiled method 0x000003ff88320c10:
[Entry Point]
[Verified Entry Point]
  # {method} {0x000003ff574004e8} 'foo' '(LTestSync;)I' in 'TestSync'
  # parm0:    c_rarg1:c_rarg1 
                        = 'TestSync'
  #           [sp+0x30]  (sp of caller)
  0x000003ff88320d80: nop
  0x000003ff88320d84: orr	x9, xzr, #0xffffffffffff0000
  0x000003ff88320d88: str	xzr, [sp,x9]
  0x000003ff88320d8c: sub	sp, sp, #0x30
  0x000003ff88320d90: stp	x29, x30, [sp,#32]  ;*synchronization entry
                                                ; - TestSync::foo at -1 (line 31)

  0x000003ff88320d94: str	x1, [sp]
  0x000003ff88320d98: ldr	x10, [x1]       ; implicit exception: dispatches to 0x000003ff8832103c
  0x000003ff88320d9c: and	x11, x10, #0x7
  0x000003ff88320da0: cmp	x11, #0x5
  0x000003ff88320da4: b.ne	0x000003ff88320e18
  0x000003ff88320da8: mov	x11, #0x60000               	// #393216
                                                ;   {metadata('TestSync')}
  0x000003ff88320dac: movk	x11, #0x28
  0x000003ff88320db0: eor	x11, x11, #0x800000000
  0x000003ff88320db4: ldr	x11, [x11,#168]
  0x000003ff88320db8: mov	x12, x28
  0x000003ff88320dbc: orr	x12, x12, x11
  0x000003ff88320dc0: eor	x13, x12, x10
  0x000003ff88320dc4: and	x14, x13, #0xffffffffffffff87
  0x000003ff88320dc8: cbnz	x14, 0x000003ff88320ff4
  0x000003ff88320dcc: dmb	ishld           ;*synchronization entry
                                                ; - TestSync::fgetQuantity at -1 (line 6)
                                                ; - TestSync::foo at 1 (line 31)

  0x000003ff88320dd0: ldr	x10, [sp]
  0x000003ff88320dd4: ldrsh	w20, [x10,#12]  ;*getfield quantity
                                                ; - TestSync::fgetQuantity at 1 (line 6)
                                                ; - TestSync::foo at 1 (line 31)

  0x000003ff88320dd8: dmb	ish
  0x000003ff88320ddc: ldr	x10, [x10]
  0x000003ff88320de0: and	x10, x10, #0x7
  0x000003ff88320de4: cmp	x10, #0x5
  0x000003ff88320de8: b.ne	0x000003ff88320f54  ;*ireturn
                                                ; - TestSync::fgetQuantity at 6 (line 7)
                                                ; - TestSync::foo at 1 (line 31)

  0x000003ff88320dec: mov	w0, w20
  0x000003ff88320df0: ldp	x29, x30, [sp,#32]
  0x000003ff88320df4: add	sp, sp, #0x30
  0x000003ff88320df8: adrp	x8, 0x000003ff97090000
                                                ;   {poll_return}
  0x000003ff88320dfc: ldr	wzr, [x8]       ;   {poll_return}
  0x000003ff88320e00: ret
  0x000003ff88320e04: ldxr	x8, [x1]
  0x000003ff88320e08: cmp	x8, x10
  0x000003ff88320e0c: b.ne	0x000003ff88320e18
  0x000003ff88320e10: stlxr	w8, x11, [x1]
  0x000003ff88320e14: cbnz	w8, 0x000003ff88320e04
  0x000003ff88320e18: add	x12, sp, #0x10
  0x000003ff88320e1c: ldr	x10, [x1]
  0x000003ff88320e20: and	x11, x12, #0x7
  0x000003ff88320e24: cmp	x11, #0x5
  0x000003ff88320e28: b.ne	0x000003ff88320eec
  0x000003ff88320e2c: ldr	w11, [x1,#8]
  0x000003ff88320e30: eor	x11, x11, #0x800000000
  0x000003ff88320e34: ldr	x11, [x11,#168]
  0x000003ff88320e38: orr	x11, x11, x28
  0x000003ff88320e3c: eor	x11, x12, x11
  0x000003ff88320e40: and	x11, x11, #0xffffffffffffff87
  0x000003ff88320e44: cbz	x11, 0x000003ff88320f44
  0x000003ff88320e48: and	x8, x11, #0x7
  0x000003ff88320e4c: cbnz	x8, 0x000003ff88320ebc
  0x000003ff88320e50: and	x8, x11, #0x300
  0x000003ff88320e54: cbnz	x8, 0x000003ff88320e88
  0x000003ff88320e58: mov	x8, #0x37f                 	// #895
  0x000003ff88320e5c: and	x12, x12, x8
  0x000003ff88320e60: orr	x11, x12, x28
  0x000003ff88320e64: ldaxr	x8, [x1]
  0x000003ff88320e68: cmp	x8, x12
  0x000003ff88320e6c: b.ne	0x000003ff88320e7c
  0x000003ff88320e70: stlxr	w8, x11, [x1]
  0x000003ff88320e74: cbz	w8, 0x000003ff88320e84
  0x000003ff88320e78: b	0x000003ff88320e64
  0x000003ff88320e7c: dmb	ish
  0x000003ff88320e80: mov	x12, x8
  0x000003ff88320e84: b	0x000003ff88320f44
  0x000003ff88320e88: ldr	w11, [x1,#8]
  0x000003ff88320e8c: eor	x11, x11, #0x800000000
  0x000003ff88320e90: ldr	x11, [x11,#168]
  0x000003ff88320e94: orr	x11, x28, x11
  0x000003ff88320e98: ldaxr	x8, [x1]
  0x000003ff88320e9c: cmp	x8, x12
  0x000003ff88320ea0: b.ne	0x000003ff88320eb0
  0x000003ff88320ea4: stlxr	w8, x11, [x1]
  0x000003ff88320ea8: cbz	w8, 0x000003ff88320eb8
  0x000003ff88320eac: b	0x000003ff88320e98
  0x000003ff88320eb0: dmb	ish
  0x000003ff88320eb4: mov	x12, x8
  0x000003ff88320eb8: b	0x000003ff88320f44
  0x000003ff88320ebc: ldr	w11, [x1,#8]
  0x000003ff88320ec0: eor	x11, x11, #0x800000000
  0x000003ff88320ec4: ldr	x11, [x11,#168]
  0x000003ff88320ec8: ldaxr	x8, [x1]
  0x000003ff88320ecc: cmp	x8, x12
  0x000003ff88320ed0: b.ne	0x000003ff88320ee0
  0x000003ff88320ed4: stlxr	w8, x11, [x1]
  0x000003ff88320ed8: cbz	w8, 0x000003ff88320eec
  0x000003ff88320edc: b	0x000003ff88320ec8
  0x000003ff88320ee0: dmb	ish
  0x000003ff88320ee4: mov	x12, x8
  0x000003ff88320ee8: b	0x000003ff88320eec
  0x000003ff88320eec: orr	x10, x10, #0x1
  0x000003ff88320ef0: str	x10, [x12]
  0x000003ff88320ef4: ldxr	x11, [x1]
  0x000003ff88320ef8: cmp	x11, x10
  0x000003ff88320efc: b.ne	0x000003ff88320f0c
  0x000003ff88320f00: stlxr	w11, x12, [x1]
  0x000003ff88320f04: cbz	w11, 0x000003ff88320f44
  0x000003ff88320f08: b	0x000003ff88320ef4
  0x000003ff88320f0c: mov	x8, sp
  0x000003ff88320f10: sub	x10, x10, x8
  0x000003ff88320f14: orr	x11, xzr, #0xffffffffffff0003
  0x000003ff88320f18: ands	x11, x10, x11
  0x000003ff88320f1c: str	x11, [x12]
  0x000003ff88320f20: b	0x000003ff88320f44
  0x000003ff88320f24: add	x11, x10, #0x16
  0x000003ff88320f28: mov	x10, xzr
  0x000003ff88320f2c: ldxr	x8, [x11]
  0x000003ff88320f30: cmp	x10, x8
  0x000003ff88320f34: b.ne	0x000003ff88320f40
  0x000003ff88320f38: stlxr	w8, x28, [x11]
  0x000003ff88320f3c: cbnz	w8, 0x000003ff88320f2c
  0x000003ff88320f40: str	x12, [x12]
  0x000003ff88320f44: b.eq	0x000003ff88320dcc
  0x000003ff88320f48: add	x2, sp, #0x10
  0x000003ff88320f4c: bl	0x000003ff88313b00  ; OopMap{[0]=Oop off=464}
                                                ;*synchronization entry
                                                ; - TestSync::fgetQuantity at -1 (line 6)
                                                ; - TestSync::foo at 1 (line 31)
                                                ;   {runtime_call}
  0x000003ff88320f50: b	0x000003ff88320dcc
  0x000003ff88320f54: add	x12, sp, #0x10
  0x000003ff88320f58: ldr	x13, [sp]
  0x000003ff88320f5c: ldr	x10, [x13]
  0x000003ff88320f60: and	x10, x10, #0x7
  0x000003ff88320f64: cmp	x10, #0x5
  0x000003ff88320f68: b.eq	0x000003ff88320fd4
  0x000003ff88320f6c: ldr	x11, [x12]
  0x000003ff88320f70: cmp	x11, xzr
  0x000003ff88320f74: b.eq	0x000003ff88320fd4
  0x000003ff88320f78: ldr	x10, [x13]
  0x000003ff88320f7c: tbnz	w11, #1, 0x000003ff88320f9c
  0x000003ff88320f80: ldxr	x10, [x13]
  0x000003ff88320f84: cmp	x12, x10
  0x000003ff88320f88: b.ne	0x000003ff88320f98
  0x000003ff88320f8c: stlxr	w10, x11, [x13]
  0x000003ff88320f90: cbz	w10, 0x000003ff88320fd4
  0x000003ff88320f94: b	0x000003ff88320f80
  0x000003ff88320f98: b	0x000003ff88320fd4
  0x000003ff88320f9c: sub	x10, x10, #0x2
  0x000003ff88320fa0: ldr	x8, [x10,#24]
  0x000003ff88320fa4: ldr	x11, [x10,#40]
  0x000003ff88320fa8: eor	x8, x8, x28
  0x000003ff88320fac: orr	x8, x8, x11
  0x000003ff88320fb0: cmp	x8, xzr
  0x000003ff88320fb4: b.ne	0x000003ff88320fd4
  0x000003ff88320fb8: ldr	x8, [x10,#64]
  0x000003ff88320fbc: ldr	x11, [x10,#56]
  0x000003ff88320fc0: orr	x8, x8, x11
  0x000003ff88320fc4: cmp	x8, xzr
  0x000003ff88320fc8: b.ne	0x000003ff88320fd4
  0x000003ff88320fcc: add	x10, x10, #0x18
  0x000003ff88320fd0: stlr	x8, [x10]
  0x000003ff88320fd4: b.eq	0x000003ff88320dec
  0x000003ff88320fd8: add	x1, sp, #0x10   ;*synchronization entry
                                                ; - TestSync::fgetQuantity at -1 (line 6)
                                                ; - TestSync::foo at 1 (line 31)

  0x000003ff88320fdc: mov	x0, x13
  0x000003ff88320fe0: mov	x8, #0x5b9c                	// #23452
                                                ;   {runtime_call}
  0x000003ff88320fe4: movk	x8, #0x97c2, lsl #16
  0x000003ff88320fe8: movk	x8, #0x3ff, lsl #32
  0x000003ff88320fec: blr	x8              ;*ireturn
                                                ; - TestSync::fgetQuantity at 6 (line 7)
                                                ; - TestSync::foo at 1 (line 31)

  0x000003ff88320ff0: b	0x000003ff88320dec
  0x000003ff88320ff4: and	x14, x13, #0x7
  0x000003ff88320ff8: cbnz	x14, 0x000003ff88320e04
  0x000003ff88320ffc: mov	x14, #0x37f                 	// #895
  0x000003ff88321000: and	x14, x10, x14
  0x000003ff88321004: mov	x11, x28
  0x000003ff88321008: and	x13, x13, #0x300
  0x000003ff8832100c: orr	x11, x11, x14
  0x000003ff88321010: cbnz	x13, 0x000003ff88321030
  0x000003ff88321014: ldxr	x8, [x1]
  0x000003ff88321018: cmp	x8, x14
  0x000003ff8832101c: b.ne	0x000003ff88321028
  0x000003ff88321020: stlxr	w8, x11, [x1]
  0x000003ff88321024: cbnz	w8, 0x000003ff88321014
  0x000003ff88321028: b.ne	0x000003ff88320f48
  0x000003ff8832102c: b	0x000003ff88320dcc
  0x000003ff88321030: mov	x11, x12
  0x000003ff88321034: mov	x14, x10
  0x000003ff88321038: b	0x000003ff88321014
  0x000003ff8832103c: mov	w1, #0xfffffff6            	// #-10
  0x000003ff88321040: bl	0x000003ff880b15c0  ; OopMap{off=708}
                                                ;*invokevirtual fgetQuantity
                                                ; - TestSync::foo at 1 (line 31)
                                                ;   {runtime_call}
  0x000003ff88321044: brk	#0x3e7          ;*invokevirtual fgetQuantity
                                                ; - TestSync::foo at 1 (line 31)

  0x000003ff88321048: .inst	0x00000000 ; undefined
  0x000003ff8832104c: .inst	0x00000000 ; undefined
  0x000003ff88321050: .inst	0x00000000 ; undefined
  0x000003ff88321054: .inst	0x00000000 ; undefined
  0x000003ff88321058: .inst	0x00000000 ; undefined
  0x000003ff8832105c: .inst	0x00000000 ; undefined
  0x000003ff88321060: .inst	0x00000000 ; undefined
  0x000003ff88321064: .inst	0x00000000 ; undefined
  0x000003ff88321068: .inst	0x00000000 ; undefined
  0x000003ff8832106c: .inst	0x00000000 ; undefined
  0x000003ff88321070: .inst	0x00000000 ; undefined
  0x000003ff88321074: .inst	0x00000000 ; undefined
  0x000003ff88321078: .inst	0x00000000 ; undefined
  0x000003ff8832107c: .inst	0x00000000 ; undefined
[Exception Handler]
[Stub Code]
  0x000003ff88321080: b	0x000003ff880d9b00      ;   {no_reloc}
[Deopt Handler Code]
  0x000003ff88321084: adr	x30, 0x000003ff88321084
  0x000003ff88321088: b	0x000003ff880b35c0      ;   {runtime_call}
  0x000003ff8832108c: .inst	0x00000000 ; undefined
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestSync.java
Type: application/octet-stream
Size: 560 bytes
Desc: not available
URL: <http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20150821/a9980f0f/TestSync-0001.java>

More information about the hotspot-compiler-dev mailing list