4 ms·
MJIT pastes together snippets of C code that implement Ruby VM bytecode instructions. It then hands off that C code to GCC which compiles it to native code whil
by jez 4y ago
MJIT pastes together snippets of C code that implement Ruby VM bytecode instructions. It then hands off that C code to GCC which compiles it to native code while the Ruby VM is running.
YJIT compiles from Ruby VM bytecode straight to native code using a JIT technique called basic block versioning (which is slightly different from how JITs like V8 work because the unit of reuse is a basic block instead of a function).
There’s more information in these links:
https://youtube.com/watch?v=zO9_uTaELCw&feature=shares https://youtube.com/watch?v=zO9_uTaELCw&feature=shares
https://shopify.engineering/yjit-just-in-time-compiler-cruby https://shopify.engineering/yjit-just-in-time-compiler-cruby