Disassemble Java JIT compiled native bytecode(反汇编 Java JIT 编译的原生字节码)
问题描述
有没有办法对 Java 即时编译器生成的本机代码进行汇编转储?
Is there any way to do an assembly dump of the native code generated by the Java just-in-time compiler?
还有一个相关的问题:有没有什么方法可以在不运行 JVM 的情况下使用 JIT 编译器将我的代码编译为本机代码?
And a related question: Is there any way to use the JIT compiler without running the JVM to compile my code into native machine code?
推荐答案
是的,有一种打印生成的本机代码的方法(需要 OpenJDK 7).
Yes, there is a way to print the generated native code (requires OpenJDK 7).
不,没有办法使用 JDK 的 JIT 将 Java 字节码编译为本机代码并将其保存为本机可执行文件.
No, there is no way to compile your Java bytecode to native code using the JDK's JIT and save it as a native executable.
即使这是可能的,它也可能没有你想象的那么有用.JVM 做了一些非常复杂的优化,如果需要,它甚至可以动态地去优化代码.换句话说,它并不像 JIT 将您的代码编译为本地机器语言那么简单,然后在程序运行时该本地机器语言将保持不变.此外,这不会让您制作独立于 JVM 和运行时库的本机可执行文件.
Even if this were possible, it would probably not as useful as you think. The JVM does some very sophisticated optimizations, and it can even de-optimize code on the fly if necessary. In other words, it's not as simple as the JIT compiles your code to native machine language, and then that native machine language will remain unchanged while the program is running. Also, this would not let you make a native executable that is independent of the JVM and runtime library.
这篇关于反汇编 Java JIT 编译的原生字节码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:反汇编 Java JIT 编译的原生字节码
基础教程推荐
- FirebaseListAdapter 不推送聊天应用程序的单个项目 - Firebase-Ui 3.1 2022-01-01
- 设置 bean 时出现 Nullpointerexception 2022-01-01
- Java Keytool 导入证书后出错,"keytool error: java.io.FileNotFoundException &拒绝访问" 2022-01-01
- 如何使用 Java 创建 X509 证书? 2022-01-01
- 在 Libgdx 中处理屏幕的正确方法 2022-01-01
- 无法使用修饰符“public final"访问 java.util.Ha 2022-01-01
- 减少 JVM 暂停时间 >1 秒使用 UseConcMarkSweepGC 2022-01-01
- 降序排序:Java Map 2022-01-01
- “未找到匹配项"使用 matcher 的 group 方法时 2022-01-01
- Java:带有char数组的println给出乱码 2022-01-01