JIT compiler
A compiler inside a runtime that turns intermediate code into native machine code while the program runs.
In more detail
JIT stands for just-in-time. Because the final compilation happens on the target machine, one compiled package can run on different processors. Some runtimes compile each method the first time it is called, and many later recompile frequently run code with heavier optimisation.
Examples
.NET: the JIT compiles IL from an assembly; ReadyToRun publishing precompiles some of it.Java: the JVM interprets bytecode first, then HotSpot's fast and optimising compilers take over hot methods, which is why a service needs a warm-up..NET, Java and web browsers use JIT compilers, so their processes legitimately contain private executable memory with no file behind it.Related terms
- IL — The processor-independent instruction set that .NET compilers produce, stored in assemblies and turned into machine code by the JIT when the program runs.
- machine code — The binary instructions a specific processor executes directly, such as arm64 or x64 instructions.
- ReadyToRun — A publishing option that precompiles much of an app's intermediate language to machine code, so startup has less JIT work to do.
- Roslyn — The open-source compiler for C# and Visual Basic, which turns source code into intermediate language inside an assembly.
- bytecode — A compact, portable instruction format that a virtual machine or interpreter executes, instead of instructions for one particular processor.
- native code — Instructions in the language of a specific processor, which the processor can execute directly.
- deoptimization — When a just-in-time compiler throws away optimised machine code because the assumptions it was built on no longer hold, and falls back to slower code.
- JVM warm-up — The first period of a Java program's life, while classes load and hot methods are still being compiled, when it runs slower than it will later.
- HotSpot — The JVM implementation developed in the OpenJDK project and used by almost every JDK distribution.
- bytecode interpreter — The part of the JVM that executes bytecode one instruction at a time, which needs no preparation but runs slower than compiled code.
- .NET — Microsoft's free, open-source platform for building and running applications, made of a runtime, a large standard library and a toolchain.
- windows.malfind — A Volatility plugin that looks for memory regions likely to hold injected code: private, executable and not backed by a file.
- private memory — Memory a process allocates for itself, not mapped from any file, as opposed to image-mapped memory loaded from an EXE or DLL.
Taught in
- What is .NET? Runtime vs SDK, and LTS vs STS — Modern .NET Core, C# & Enterprise Microservices
- The Virtual Machine, The Kit And The Runtime — Modern Java: Virtual Threads & High-Throughput Services
- The Lifecycle Of A Java Program — Modern Java: Virtual Threads & High-Throughput Services
- Memory Forensics: Process Trees & Injection — Security Operations & Threat Hunting (SOC)