Meta-compilers, JITs & virtual machines
Copy-and-Patch Compilation
A technique that generates machine code by copying pre-built binary stencils and patching in constants and addresses, producing baseline code far faster than a traditional compiler backend.
The problem
Fast baseline and JIT compilers need to emit code quickly, but building and maintaining a code generator for each instruction set is a large engineering effort.
The idea
Precompile a library of binary code stencils ahead of time, then at runtime stitch and patch them together — giving very fast compilation with no runtime dependency on a heavyweight backend like LLVM.
How it fits the group's work
Copy-and-patch shows how a compiler can be derived rather than hand-written: the slow, general-purpose optimizer (LLVM) is used offline to build stencils, and the online compiler becomes a fast assembler of those stencils. It underpins Deegen, the group’s virtual-machine generator, and connects to the broader interest in meta-compilation — systems that generate compilers and runtimes instead of writing them by hand.