即时编译器和解释器有什么区别?
Just-in-Time-Compiler 和 Interpreter 有什么区别,.NET 和 Java JIT 编译器有什么区别?
What are the differences between a Just-in-Time-Compiler and an Interpreter, and are there differences between the .NET and the Java JIT compiler?
推荐答案
Just-in-时间编译是在执行之前将非本地代码(例如字节码)转换为本地代码.
Just-in-time compilation is the conversion of non-native code, for example bytecode, into native code just before it is executed.
来自维基百科:
JIT 建立在运行时环境中的两个早期想法之上:字节码编译和动态编译.它在本机执行之前在运行时转换代码,例如将字节码转换为本机机器码.
JIT builds upon two earlier ideas in run-time environments: bytecode compilation and dynamic compilation. It converts code at runtime prior to executing it natively, for example bytecode into native machine code.
interpreter 执行程序.它可能有也可能没有抖动.
An interpreter executes a program. It may or may not have a jitter.
再次,来自维基百科:
解释器可能是一个程序要么
An interpreter may be a program that either
- 直接执行源代码
- 将源代码翻译成一些有效的中间表示(代码)并立即执行
- 显式执行由编译器生成的存储的预编译代码这是解释器的一部分系统
标准的 Java 和 .NET 发行版都具有 JIT 编译,但标准并不要求它..NET 和 C# 中的 JIT 编译器当然不同,因为中间字节码不同.原理是一样的.
Both the standard Java and .NET distributions have JIT compilation, but it is not required by the standards. The JIT compiler in .NET and C# are of course different because the intermediate bytecode is different. The principle is the same though.
相关文章