Retrospective of the MoarVM JIT
Hi hackers! Today the MoarVM JIT project is nearly 9 years old. I was inspired by Jonathan's presentation reflecting on the development of MoarVM, to do the same for the MoarVM JIT, for which I have been responsible. For those who are unfamiliar, what is commonly understood as 'JIT compilation' for virtual machines is performed by two components in MoarVM. A framework for runtime type specialization (' spesh ') A native code generation backend for the specialized code (the 'JIT'). This post refers only to the native code generation backend component. It, too, is split into two mostly-independent systems: A backend that emits code directly from MoarVM instructions from machine code templates (the 'lego' JIT compiler). Another backend that transforms MoarVM instructions into an expression-based intermediate representation and compiles machine code based on that (the 'expression' compiler). Things that worked well Using DynASM for code generat