hsdis is a plugin for the HotSpot Oracle JVM that allows you to print out the assembly of JIT'ed calls.
I built the artifact in this repo using binutils 2.28.
Instructions for installing are below.
cd $JAVA_HOME/jre/lib/server
wget https://raw.githubusercontent.com/a10y/hsdis-macos/master/hsdis-amd64.dylib
cd $JAVA_HOME/lib/server
wget https://raw.githubusercontent.com/a10y/hsdis-macos/master/hsdis-amd64.dylib
Assuming we have classfile Main.class
present, a simple usage that works on JDK 1.8 and 1.9:
java -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly Main