diff options
author | Dmitry Stogov <dmitry@zend.com> | 2014-12-22 16:44:39 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2014-12-22 16:44:39 +0300 |
commit | 2646f7bcb98dcdd322ea21701c8bb101104ea619 (patch) | |
tree | 6cfa66ba666378de3c59759079e17f3245af0281 /Zend/zend_execute.c | |
parent | 2bc63e7b6d348e9210ec09facb4bedb6f4ab921a (diff) | |
download | php-git-2646f7bcb98dcdd322ea21701c8bb101104ea619.tar.gz |
Don't count variadic argument in zend_func.common.num_args. This allows faster CALL/RETURN code.
Diffstat (limited to 'Zend/zend_execute.c')
-rw-r--r-- | Zend/zend_execute.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index f7dc69c099..aaa25cabca 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -622,7 +622,7 @@ static void zend_verify_internal_arg_type(zend_function *zf, uint32_t arg_num, z if (EXPECTED(arg_num <= zf->internal_function.num_args)) { cur_arg_info = &zf->internal_function.arg_info[arg_num-1]; } else if (zf->internal_function.fn_flags & ZEND_ACC_VARIADIC) { - cur_arg_info = &zf->internal_function.arg_info[zf->internal_function.num_args-1]; + cur_arg_info = &zf->internal_function.arg_info[zf->internal_function.num_args]; } else { return; } @@ -671,7 +671,7 @@ static void zend_verify_arg_type(zend_function *zf, uint32_t arg_num, zval *arg, if (EXPECTED(arg_num <= zf->common.num_args)) { cur_arg_info = &zf->common.arg_info[arg_num-1]; } else if (zf->common.fn_flags & ZEND_ACC_VARIADIC) { - cur_arg_info = &zf->common.arg_info[zf->common.num_args-1]; + cur_arg_info = &zf->common.arg_info[zf->common.num_args]; } else { return; } @@ -720,7 +720,7 @@ static inline int zend_verify_missing_arg_type(zend_function *zf, uint32_t arg_n if (EXPECTED(arg_num <= zf->common.num_args)) { cur_arg_info = &zf->common.arg_info[arg_num-1]; } else if (zf->common.fn_flags & ZEND_ACC_VARIADIC) { - cur_arg_info = &zf->common.arg_info[zf->common.num_args-1]; + cur_arg_info = &zf->common.arg_info[zf->common.num_args]; } else { return 1; } @@ -1626,9 +1626,6 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu /* Handle arguments */ first_extra_arg = op_array->num_args; - if (UNEXPECTED((op_array->fn_flags & ZEND_ACC_VARIADIC) != 0)) { - first_extra_arg--; - } num_args = EX_NUM_ARGS(); if (UNEXPECTED(num_args > first_extra_arg)) { zval *end, *src, *dst; @@ -1721,9 +1718,6 @@ static zend_always_inline void i_init_execute_data(zend_execute_data *execute_da /* Handle arguments */ first_extra_arg = op_array->num_args; - if (UNEXPECTED((op_array->fn_flags & ZEND_ACC_VARIADIC) != 0)) { - first_extra_arg--; - } num_args = EX_NUM_ARGS(); if (UNEXPECTED(num_args > first_extra_arg)) { zval *end, *src, *dst; |