Skip to content

Slightly improve performance of zend_copy_extra_args #18146

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
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Zend/zend_execute.c
Original file line number Diff line number Diff line change
Expand Up @@ -4180,9 +4180,8 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_fcall_interrupt(zend_execute_data *ca
* on the zend_execute_data, and when the executor leaves the function, the
* args will be freed in zend_leave_helper.
*/
static zend_never_inline void zend_copy_extra_args(EXECUTE_DATA_D)
static zend_never_inline void zend_copy_extra_args(const zend_op_array *op_array EXECUTE_DATA_DC)
{
zend_op_array *op_array = &EX(func)->op_array;
uint32_t first_extra_arg = op_array->num_args;
uint32_t num_args = EX_NUM_ARGS();
zval *src;
Expand Down Expand Up @@ -4257,7 +4256,7 @@ static zend_always_inline void i_init_func_execute_data(zend_op_array *op_array,
num_args = EX_NUM_ARGS();
if (UNEXPECTED(num_args > first_extra_arg)) {
if (!may_be_trampoline || EXPECTED(!(op_array->fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE))) {
zend_copy_extra_args(EXECUTE_DATA_C);
zend_copy_extra_args(op_array EXECUTE_DATA_CC);
}
} else if (EXPECTED((op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0)) {
/* Skip useless ZEND_RECV and ZEND_RECV_INIT opcodes */
Expand Down
Loading