On-stack replacement (OSR)
The trick that lets a JIT swap out a function's code while it is still running, so a long loop doesn't stay stuck in the interpreter.
A JIT normally compiles a method once it has been called often enough, and the next call gets the fast version. That does nothing for a main that is called once and then loops for ten minutes. OSR fixes this by counting iterations on the loop's back edge. When the counter trips, the JIT compiles a special version of the function with an entry point in the middle of the loop, translates the interpreter's stack frame into the compiled code's layout — moving locals into the right registers and stack slots — and jumps across.
The idea comes from the Self project in the early 1990s and lives on in HotSpot, V8 and most other serious JITs. The opposite direction, from optimized code back to the interpreter, is deoptimization. OSR is also why Java microbenchmarks lie so often: a loop in main measures the OSR version, which is rarely as good as the regular one.