我发现这个问题可以回答 C++ 的问题:
如何从 gcc 中的 C/C++ 源代码获取汇编程序输出?
Java uses both bytecode and assembly language machine code. It's a two-step process. The first step is to compile the Java source code to bytecode, as @elliott-frisch pointed out. At runtime, the JVM watches which parts of the program are used a lot. If a method "runs hot", it's compiled to machine code. That, in turn, is a multi-step process itself, including many optimizations and replacing fast code with even faster code. I've described this in BeyondJava.net several years ago.
如果您能抽出 45 分钟时间,我还建议您观看 Charles Nutter 的演讲。“掉进兔子洞”很好地介绍了 Java 如何编译为汇编语言。
至于你的问题:你必须在启动应用程序的命令中添加一些参数:
javaw.exe -XX:+UnlockDiagnosticVMOptions -XX:+PrintAssembly Adder
您还必须下载一个特殊的 DLL 并将其存储在 jre 文件夹中。另请参阅克里斯·纽兰兹文章关于如何为 OS X 编译此文件。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)