2 ms·
They absolutely are rolling their own JIT (doing otherwise would reduce its value substantially or simply be infeasible.) The sentence above is just badly writt
by aseipp 6y ago
They absolutely are rolling their own JIT (doing otherwise would reduce its value substantially or simply be infeasible.) The sentence above is just badly written in the original article. The PHP 8 JIT uses the "DynASM" library to help generate code in memory — which was originally developed for use in LuaJIT 1. (LuaJIT 2 does not use DynASM for its own runtime code generation, but it does use DynASM instead as a sort of "super" macro assembler when you compile it, making it easier to write its optimized, per-architecture interpreter.)
But "just" putting encoded instructions in a memory buffer is the easy part of it all, and that's all DynASM does. You still need thousands of lines of code backing it up to actually generate the right instructions, and implement appropriate optimizations.