Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想知道jvm是如何编译类文件的,当JIT编译jvm处理的类文件时,输出的是汇编源代码或二进制可执行代码。换句话说,JVM是如何编译类文件的,然后会做什么。提前致谢
这些答案是特定于实现的......
Hotspot JIT 编译器不编译为汇编源代码。相反,它将本机代码指令直接发送到准备执行的内存中。
根据 Hotpot 版本、JVM 切换等,JIT 编译发生在 JVM 使用字节码解释器执行了几次方法之后。在最近的 JVM 中,在初始解释阶段收集统计信息,然后帮助 JIT 编译器生成更好的代码。