Just-in-time compilation is the conversion of non-native code, for example bytecode, into native code just before it is executed.
From Wikipedia:
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.
An interpreter executes a program. It may or may not have a jitter.
Again, from Wikipedia:
An interpreter may be a program that
either
- executes the source code directly
- translates source code into some efficient intermediate representation
(code) and immediately executes this
- explicitly executes stored precompiled code made by a compiler
which is part of the interpreter
system
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.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…