2 ms·
> My dream is to understand JIT compiler tech. Does anybody have any resources? Mike Pall's posts and LuaJIT is probably a good bet. For a higher-level overvi
by masklinn 4y ago
> My dream is to understand JIT compiler tech. Does anybody have any resources?
Mike Pall's posts and LuaJIT is probably a good bet.
For a higher-level overview, I dimly remember that Mozilla used to have a number of posts on the subject. V8 / Chrome as well, especially as they moved back, forth, and sideways on the subkect.
> Do JIT compilers create machine code templates of bytecode instructions and then emit that? Or do they create basic blocks and then emit that as machine code?
That very much depends on the JIT. It can go from just swapping in precompiled code templates to type-directed compilation and AOT-style optimisations (loop unrolling, inlining, devirtualisation, ...), as well as things AOT compilers don't usually do (to my knowledge) like runtime-dispatched specialisation.