Printassembly is a diagnostic flag for the hotspot JVM that allows us to obtain the JIT compiler/or assembly instructions generated during the interpretation process, which can often be used to help us find problems by analyzing the execution of assembly instructions, or to help us analyze and understand the JVM How it is interpreted and compiled.
How to install these are not directly provided by the JVM, the way in which plug-ins are needed in the JVM, and the Kenai Project provides this plug-in
Download: https://kenai.com/projects/base-hsdis/downloads
Find the corresponding instruction set, the operating system corresponding to the so file download, does not seem to support windows
Installation directory: Your libjvm.so the same directory
$JAVA _PATH/JRE/LIB/CPU Instruction Set/server/
For example:
$JAVA _path/jre/lib/amd64/server/
File name naming rules
1. Different instruction sets use the hsdis-instruction set
Hsdis-amd64, Hsdis-sparc, hsdis-sparcv9
2. So file renamed as Lib prefix file name, which seems to be the JVM bug (http://mail.openjdk.java.net/pipermail/hotspot-dev/2011-July/004284.html)
such as libhdis-amd64.so
Common usage Parameters
+printassembly Print assembly code for bytecoded and native methods +printnmethods
print Nmethods as they are generate D
+printnativenmethods Print native method wrappers as they are generated +printsignaturehandlers
print native Me Thod signature Handlers
+printadapterhandlers print adapters (I2C, c2i) as they are generated +printstubcode prin
T stubs:deopt, uncommon Trap, exception, SafePoint, runtime support +printinterpreter
print interpreter code
Using these parameters requires opening the parameters first
-xx:+unlockdiagnosticvmoptions
Common usage
-xx:+unlockdiagnosticvmoptions-xx:+printassembly
printassembly Print JIT-compiled assembly
Compilation of Printinterpreter print interpretations
How to filter output
-xx:compilecommand=print,*myclass.mymethod prints assembly for just one method
-xx:compilecommand=option,* myclass.mymethod,printoptoassembly (Debug build only) produces the old Print command output
-xx:compilecommand= Option,*myclass.mymethod,printnmethods produces method dumps
You can set the filter and output the assembly of the method you want.