xref: /PHP-8.0/ext/opcache/jit/README.md (revision 3e045d5f)
1Opcache JIT
2===========
3
4This is the implementation of Opcache's JIT (Just-In-Time compiler),
5This converts the PHP Virtual Machine's opcodes into x64/x86 assembly,
6on POSIX platforms and Windows.
7
8It generates native code directly from PHP byte-code and information collected
9by the SSA static analysis framework (a part of the opcache optimizer).
10Code is usually generated separately for each PHP byte-code instruction. Only
11a few combinations are considered together (e.g. compare + conditional jump).
12
13See [the JIT RFC](https://wiki.php.net/rfc/jit) for more details.
14
15DynAsm
16------
17
18This uses [DynAsm](https://luajit.org/dynasm.html) (developed for LuaJIT project)
19for the generation of native code.  It's a very lightweight and advanced tool,
20but does assume good, and very low-level development knowledge of target
21assembler languages. In the past we tried LLVM, but its code generation speed
22was almost 100 times slower, making it prohibitively expensive to use.
23
24[The unofficial DynASM Documentation](https://corsix.github.io/dynasm-doc/tutorial.html)
25has a tutorial, reference, and instruction listing.
26
27`zend_jit_x86.dasc` gets automatically converted to `zend_jit_x86.c` by the bundled
28`dynasm` during `make`.
29