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

AArch64: save two words in itable lookup stub

XMLWordPrintable

    • b17
    • aarch64

        vtable stubs are hot in some apps. Looking to asm codes we see it can make it a bit shorter.

        $ java -XX:+PrintAdapterHandlers
        Decoding VtableStub itbl[3]@2
            ------------------------- VtableStubs::create_itable_stub
         1 ldp x16, x12, [x9]
         2 ldr w10, [x1, #8]
         3 eor x10, x10, #0x800000000
            ......................... lookup_interface_method(1)
         4 ldr w11, [x10, #16]
         5 add x11, x10, x11, uxtx #3
         6 add x11, x11, #0x1d0
         7 ldr x15, [x11]
         8 cmp x12, x15
         9 b.eq 0x0000ffff710ff2f8
        10 cbz x15, 0x0000ffff710ff338
        11 add x11, x11, #0x10 ------->
        12 ldr x15, [x11] ------------------> ldr x15, [x11, #16]!
        13 cmp x12, x15
        14 b.ne 0x0000ffff710ff2e4
            ......................... lookup_interface_method(2)
        15 ldr w11, [x10, #16]
        16 add x11, x10, x11, uxtx #3
        17 add x11, x11, #0x1d0
        18 add x10, x10, #0x18
        19 ldr x12, [x11]
        20 cmp x16, x12
        21 b.eq 0x0000ffff710ff328
        22 cbz x12, 0x0000ffff710ff338
        23 add x11, x11, #0x10 ------>
        24 ldr x12, [x11] -----------------> ldr x12, [x11, #16]!
        25 cmp x16, x12
        26 b.ne 0x0000ffff710ff314
        27 ldr w11, [x11, #8]
        28 ldr x12, [x10, w11, uxtw]
            ......................... VtableStubs::create_itable_stub (continue)
        29 ldr x8, [x12, #56]
        30 br x8
        31 adrp x8, Stub::<unknown>
        32 add x8, x8, #0xe80
        33 br x8
        34 .inst 0x00000000 ; undefined

              bulasevich Boris Ulasevich
              bulasevich Boris Ulasevich
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: