~/talk

Build Your Own VM with JIT Compilation for Dummies

TalkinFrenchat Devoxx France 2024 · 2024-04-17..04-19· [compilers-and-language-design]
slides:none on file

A small virtual machine is implemented for an RPN calculator: a parser generates a compact bytecode, an interpreter runs it on first execution, and a JIT translator emits x86_64 machine code into mmaped RWX pages. The generated code follows the SysV AMD64 calling convention (RDI, RSI, RDX, RCX, R8, R9, preserved registers), writes prologue/body/epilogue bytes, stitches contiguous basic blocks with distinct entry points, and calls the produced function pointer to achieve faster repeated runs (demonstrated with a Fibonacci example).

AI-written summary · about

  1. 0:00JIT introduction
  2. 5:10Simple VM creation
  3. 16:20Machine code generation
  4. 23:07JIT generator
  5. 31:14Basic Blocks concept
  6. 33:01JIT integration
  7. 36:14Live demo
  8. 40:29Conclusion
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.