-
Notifications
You must be signed in to change notification settings - Fork 1
Partials v2 #12
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
base: master
Are you sure you want to change the base?
Partials v2 #12
Conversation
Like __call trampolines, we can use an opcode-based trampoline to reduce recursion/reentering, and reuse the call frame of the trampoline. Also: Rebase fixes, update tests, add tests.
/* Internal functions use an incompatible arg_info struct | ||
* TODO: unify zend_arg_info / zend_internal_arg_info? */ |
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.
This would be nice to do, but that would require allocating zend_strings rather than using C strings which are inside the binary. Would make a lot of other stuff simpler tho.
Zend/zend_types.h
Outdated
/* used for place holders */ | ||
#define _IS_PLACEHOLDER_ARG 20 | ||
#define _IS_PLACEHOLDER_VARIADIC 21 |
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.
Probably should be bellow _IS_NUMBER
It looks like we still need a test for partially applying an invokable object that isn't a Closure. |
$f = f(?, ?); | ||
|
||
$f(1, 2); | ||
|
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.
Please add a closing PHP tag in every test.
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.
We should have a linter for this kind of things :)
Based on php#6898.
With the following changes:
trampoline
is now a user function. This avoids re-entering the VM, and allows to re-use the trampoline stack frame when calling the real function. This is similar to__call
trampolines.trampoline
andprototype
are merged into a singlezend_function
. This simplifies a few things and speeds up PFA creation a bit.ZEND_ACC_
andZEND_CALL_
flags since there are no free slots anymorenew
is not allowedStill a WIP. There are a few things to check and cleanup.
TODO: