This document outlines how you can print the assembly code generated by the JVM.
It relies on the -XX:+PrintAssembly
VM option available since java7 and requires also -XX:+UnlockDiagnosticVMOptions
.
java -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly MyClassFile
In order to print assembly code you need a disassembler plugin such as FCML.
If you are running on Linux you may be able to install directly the required libraries (hsdis-amd64.so
)
via a package manager.
In Ubuntu you can type the following command: