diff options
author | Tyson Andre <tysonandre775@hotmail.com> | 2020-05-17 13:04:11 -0400 |
---|---|---|
committer | Tyson Andre <tysonandre775@hotmail.com> | 2020-05-20 09:58:24 -0400 |
commit | 27b849ec9ae4abbcc13302c42c01d2e403801285 (patch) | |
tree | 9e8117ac2a6a4fd5c81d487ab00535b01b10abea /ext | |
parent | 25aa125530d0598136c106fd4935e3bcf587e7ce (diff) | |
download | php-git-27b849ec9ae4abbcc13302c42c01d2e403801285.tar.gz |
[skip ci] Add a README for Opcache's JIT.
Mention information that would be useful for working on new features or bug
fixes for the JIT.
Closes GH-5585
Diffstat (limited to 'ext')
-rw-r--r-- | ext/opcache/jit/README.md | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/ext/opcache/jit/README.md b/ext/opcache/jit/README.md new file mode 100644 index 0000000000..834ecc390d --- /dev/null +++ b/ext/opcache/jit/README.md @@ -0,0 +1,28 @@ +Opcache JIT +=========== + +This is the implementation of Opcache's JIT (Just-In-Time compiler), +This converts the PHP Virtual Machine's opcodes into x64/x86 assembly, +on POSIX platforms and Windows. + +It generates native code directly from PHP byte-code and information collected +by SSA static analysis framework (a part of the opcache optimizer). +Code is usually generated separately for each PHP byte-code instruction. Only +a few combinations are considered together (e.g. compare + conditional jump). + +See [the JIT RFC](https://wiki.php.net/rfc/jit) for more details. + +DynAsm +------ + +This uses [DynAsm](https://luajit.org/dynasm.html) (developed for LuaJIT project) +for the generation of native code. It's a very lightweight and advanced tool, +but does assume good, and very low-level development knowledge of target +assembler languages. In the past we tried LLVM, but its code generation speed +was almost 100 times slower, making it prohibitively expensive to use. + +[The unofficial DynASM Documentation](https://corsix.github.io/dynasm-doc/tutorial.html) +has a tutorial, reference, and instruction listing. + +`zend_jit_x86.dasc` gets automatically converted to `zend_jit_x86.c` by the bundled +`dynasm` during `make`. |