Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to view the machine code generated by the JVM hotspot compiler?

I was wondering, is it possible to get eyes on the actual machine code that the HotSpot compiler generates when it compiles a given Java bytecode class or method?

like image 809
Recusiwe Avatar asked Jul 12 '14 23:07

Recusiwe


1 Answers

Yes, with -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly the Hotspot VM can give you that information when it actually executes (compiles) a given bytecode method.

See for example HotSpotInternals Wiki:Print Assembly for details. It does require a disassembler module (hsdis-*.dll on Windows).

A bit more comfortable is using JITWatch (but it uses the same infrastructure from HotSpot).

like image 139
2 revs, 2 users 94% Avatar answered Oct 07 '22 22:10

2 revs, 2 users 94%