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

Use 'nop' to replace 'mov' when patching instructions

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • 16
    • hotspot
    • aarch64
    • generic


      [Stub Code]
        0x0000ffff950dbe80: ldr x8, 0x0000ffff950dbe88 ; {no_reloc}
        0x0000ffff950dbe84: br x8
        0x0000ffff950dbe88: bl 0x0000ffff992bdd88
        0x0000ffff950dbe8c: .inst 0x0000ffff ; undefined
        0x0000ffff950dbe90: isb ; {static_stub}
        0x0000ffff950dbe94: mov x12, #0x0 // #0
                                                                  ; {metadata(NULL)}
        0x0000ffff950dbe98: movk x12, #0x0, lsl #16
        0x0000ffff950dbe9c: movk x12, #0x0, lsl #32
        0x0000ffff950dbea0: mov x8, #0x0 // #0
        0x0000ffff950dbea4: movk x8, #0x0, lsl #16
        0x0000ffff950dbea8: movk x8, #0x0, lsl #32
        0x0000ffff950dbeac: br x8
       

       As some runtime addresses haven't known yet, 'movptr' uses three 'mov' instructions as a placeholder, e.g. those triple mov   zero in the above code. At patching time, some of those known addresses may not need total three 'mov' to build up, e.g. 0xffffffffffff could use just one 'mov'(movn dst, 0). For those unused one or two mov placeholders, we can patch them as 'nop' so that processor may move them out of the pipeline. 

       

            eliu Eric Liu
            eliu Eric Liu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: