4 ms·
Tangentially, here is one way to think about how tracing JIT works: 1. Set a breakpoint at the start of a loop that you want to compile. 2. Single-step one it
by lukego 8y ago
Tangentially, here is one way to think about how tracing JIT works:
1. Set a breakpoint at the start of a loop that you want to compile.
2. Single-step one iteration of the loop, stepping down into every function call, logging everything that the code does.
3. Compile the log into native code.
Now any time you need to run this loop again, in the same way, you just branch to the generated code to efficiently "replay" the log of how it ran before.
The rest, as they say, is details...