简体   繁体   English

是否可以查看JVM热点编译器生成的机器代码?

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

我想知道,是否可以了解HotSpot编译器在编译给定的Java字节码类或方法时生成的实际机器代码?

Yes, with -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly the Hotspot VM can give you that information when it actually executes (compiles) a given bytecode method. 是的,使用-XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly ,Hotspot VM可以在实际执行(编译)给定的字节码方法时为您提供该信息。

See for example HotSpotInternals Wiki:Print Assembly for details. 有关详细信息,请参阅HotSpotInternals Wiki:Print Assembly It does require a disassembler module (hsdis-*.dll on Windows). 它确实需要一个反汇编程序模块(Windows上的hsdis - * .dll)。

A bit more comfortable is using JITWatch (but it uses the same infrastructure from HotSpot). 使用JITWatch更舒服(但它使用来自HotSpot的相同基础架构)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM