-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Add ZEND_INIT_ICALL instruction #13445
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
Conversation
663baf6
to
ff88578
Compare
ff88578
to
163f67f
Compare
65fe4ff
to
1789c86
Compare
1789c86
to
e55e968
Compare
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.
Nice! This also avoids a hash lookup when the run time cache is not primed yet for a call site.
Could this be generalized to top level functions declared in the same file as the caller? Maybe to preloaded functions as well (not sure about that one).
Right, that too! That's likely the bigger factor that I didn't consider.
Hmm, probably. The pointer will need to be fixed once the function is moved to shm. This might need a second pass, since functions can reference each other. I can have a look when this is merged. In that case though, it might make sense to rename this opcode. |
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.
I see very slight speed improvement and I think it doesn't cost the current complexity of the patch.
Most probably this complexity may be significantly reduced.
For exampee instead of introduction of a new INIT_ICALL
instruction, we may use a specialized handler for existing INIT_FCALL
that relays on type of the constant operand (PTR instead of STRING).
May be we should even keep both STRING and additional PTR to reduce the fragmentation with Windows and simplify file cache support (it's missed now).
Closed in favor of #13634. |
This avoids (compared to
ZEND_INIT_FCALL
):(char*)opline + opline->op2.constant
vs(char*)execute_data->run_time_cache + opline->result.num
NULL
checkSymfony Demo:
Seems a bit high. 🤷♂️