-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[skip ci] Add a README for Opcache's JIT. #5585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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`. |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed that comment - I addressed that in 3e045d5