XCHG is slow ?

John Rose john.r.rose at oracle.com
Tue Jul 3 16:39:25 PDT 2012


On Jul 3, 2012, at 4:35 PM, Rémi Forax wrote:

> I have no idea, is there a way to print the encoding of each instructions ?

Happily, yes.  After your -XX:+PrintAssembly option, add -XX:PrintAssemblyOptions=help.  If that bears fruit, use -XX:PrintAssemblyOptions=hsdis-print-bytes.  Sample output:

method handle interpreter entry for _linkToStatic
  0x0000000104760bcf: data32 data32 nopw 0x0(%rax,%rax,1)
                                                ;...6666660f 1f8400
                                                ;...00000000
  0x0000000104760bda: data32 data32 xchg %ax,%ax  ;...66666690
  0x0000000104760bde: xchg   %ax,%ax            ;...6690
  0x0000000104760be0: movzwl 0x32(%rbx),%edx    ;...0fb75332
  0x0000000104760be4: pop    %rax               ;...58
  0x0000000104760be5: pop    %rbx               ;...5b
  0x0000000104760be6: push   %rax               ;...50
  0x0000000104760be7: mov    0x40(%rbx),%rbx    ;...488b5b40
  0x0000000104760beb: jmpq   *0x78(%rbx)        ;…ff6378

— John


-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20120703/4b40c02d/attachment.html 


More information about the hotspot-compiler-dev mailing list