It's All Relative

Performance Minded

16 Oct 2012

1 min read

In my previous post, I have shown you some disassembly from JIT native code. How to do the same at home?

I found relevant informations in this wiki page.

First, you need to get the dissasembler named

Then launch your java command with the following options: -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly

Then you will get:

"C:\Program Files (x86)\Java\jdk1.6.0_23\jre\bin\java" -server
-XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly com.bempel.sandbox.TestJIT
Java HotSpot(TM) Server VM warning: PrintAssembly is enabled; turning on
DebugNonSafepoints to gain additional output
Loaded disassembler from hsdis-i386.dll
Decoding compiled method 0x02548708:
[Disassembling for mach='i386']
[Entry Point]
[Verified Entry Point]
  # {method} 'run' '()V' in 'com/bempel/sandbox/TestJIT$C'

Enjoy !

Updated: To get intel syntax over AT&T, use -XX:PrintAssemblyOptions=intel