]> granicus.if.org Git - php/commitdiff
Pack EX(num_args) into EX(This).u2.num_args
authorDmitry Stogov <dmitry@zend.com>
Fri, 28 Nov 2014 07:28:49 +0000 (10:28 +0300)
committerDmitry Stogov <dmitry@zend.com>
Fri, 28 Nov 2014 07:28:49 +0000 (10:28 +0300)
Zend/zend_API.c
Zend/zend_API.h
Zend/zend_builtin_functions.c
Zend/zend_compile.h
Zend/zend_execute.c
Zend/zend_execute.h
Zend/zend_execute_API.c
Zend/zend_types.h
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index e22b55745126e1a710043abcbcfb0dd6c9822725..2aff386fb6044b17589050faafe3a98340e49a6b 100644 (file)
@@ -51,7 +51,7 @@ ZEND_API int zend_get_parameters(int ht, int param_count, ...) /* {{{ */
        TSRMLS_FETCH();
 
        param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1);
-       arg_count = EG(current_execute_data)->num_args;
+       arg_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
 
        if (param_count>arg_count) {
                return FAILURE;
@@ -87,7 +87,7 @@ ZEND_API int zend_get_parameters_ex(int param_count, ...) /* {{{ */
        TSRMLS_FETCH();
 
        param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1);
-       arg_count = EG(current_execute_data)->num_args;
+       arg_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
 
        if (param_count>arg_count) {
                return FAILURE;
@@ -111,7 +111,7 @@ ZEND_API int _zend_get_parameters_array_ex(int param_count, zval *argument_array
        int arg_count;
 
        param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1);
-       arg_count = EG(current_execute_data)->num_args;
+       arg_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
 
        if (param_count>arg_count) {
                return FAILURE;
@@ -133,7 +133,7 @@ ZEND_API int zend_copy_parameters_array(int param_count, zval *argument_array TS
        int arg_count;
 
        param_ptr = ZEND_CALL_ARG(EG(current_execute_data), 1);
-       arg_count = EG(current_execute_data)->num_args;
+       arg_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
 
        if (param_count>arg_count) {
                return FAILURE;
@@ -920,7 +920,7 @@ static int zend_parse_va_args(int num_args, const char *type_spec, va_list *va,
                return FAILURE;
        }
 
-       arg_count = EG(current_execute_data)->num_args;
+       arg_count = ZEND_CALL_NUM_ARGS(EG(current_execute_data));
 
        if (num_args > arg_count) {
                zend_error(E_WARNING, "%s(): could not obtain parameters for parsing",
index 46e284be7f11c03f47f7b9dfe2627dc9dc936985..6817e85f9b57d72a82228320728730448193d3f4 100644 (file)
@@ -346,8 +346,8 @@ ZEND_API char *zend_get_type_by_const(int type);
 
 #define WRONG_PARAM_COUNT                                      ZEND_WRONG_PARAM_COUNT()
 #define WRONG_PARAM_COUNT_WITH_RETVAL(ret)     ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret)
-#define ARG_COUNT(dummy)                                       EX(num_args)
-#define ZEND_NUM_ARGS()                                                EX(num_args)
+#define ARG_COUNT(dummy)                                       EX_NUM_ARGS()
+#define ZEND_NUM_ARGS()                                                EX_NUM_ARGS()
 #define ZEND_WRONG_PARAM_COUNT()                                       { zend_wrong_param_count(TSRMLS_C); return; }
 #define ZEND_WRONG_PARAM_COUNT_WITH_RETVAL(ret)                { zend_wrong_param_count(TSRMLS_C); return ret; }
 
@@ -712,7 +712,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
                const int _flags = (flags); \
                int _min_num_args = (min_num_args); \
                int _max_num_args = (max_num_args); \
-               int _num_args = EX(num_args); \
+               int _num_args = EX_NUM_ARGS(); \
                int _i; \
                zval *_real_arg, *_arg = NULL; \
                zend_expected_type _expected_type = IS_UNDEF; \
index ecb8f4e0d1d7e18c09c33eec59d7e606656aaaad..b21ff5f7719f5c6931e35fdd2ce5cc5be79d2e16 100644 (file)
@@ -403,7 +403,7 @@ ZEND_FUNCTION(func_num_args)
        zend_execute_data *ex = EX(prev_execute_data);
 
        if (VM_FRAME_KIND(ex->frame_info) == VM_FRAME_NESTED_FUNCTION || VM_FRAME_KIND(ex->frame_info) == VM_FRAME_TOP_FUNCTION) {
-               RETURN_LONG(ex->num_args);
+               RETURN_LONG(ZEND_CALL_NUM_ARGS(ex));
        } else {
                zend_error(E_WARNING, "func_num_args():  Called from the global scope - no function context");
                RETURN_LONG(-1);
@@ -435,7 +435,7 @@ ZEND_FUNCTION(func_get_arg)
                RETURN_FALSE;
        }
 
-       arg_count = ex->num_args;
+       arg_count = ZEND_CALL_NUM_ARGS(ex);
 
        if (requested_offset >= arg_count) {
                zend_error(E_WARNING, "func_get_arg():  Argument " ZEND_LONG_FMT " not passed to function", requested_offset);
@@ -446,7 +446,7 @@ ZEND_FUNCTION(func_get_arg)
        if (ex->func->op_array.fn_flags & ZEND_ACC_VARIADIC) {
                first_extra_arg--;
        }
-       if (requested_offset >= first_extra_arg && (ex->num_args > first_extra_arg)) {
+       if (requested_offset >= first_extra_arg && (ZEND_CALL_NUM_ARGS(ex) > first_extra_arg)) {
                arg = EX_VAR_NUM_2(ex, ex->func->op_array.last_var + ex->func->op_array.T) + (requested_offset - first_extra_arg);
        } else {
                arg = ZEND_CALL_ARG(ex, requested_offset + 1);
@@ -469,7 +469,7 @@ ZEND_FUNCTION(func_get_args)
                RETURN_FALSE;
        }
 
-       arg_count = ex->num_args;
+       arg_count = ZEND_CALL_NUM_ARGS(ex);
 
        array_init_size(return_value, arg_count);
        if (arg_count) {
@@ -483,7 +483,7 @@ ZEND_FUNCTION(func_get_args)
                i = 0;
                q = Z_ARRVAL_P(return_value)->arData;
                p = ZEND_CALL_ARG(ex, 1);
-               if (ex->num_args > first_extra_arg) {
+               if (ZEND_CALL_NUM_ARGS(ex) > first_extra_arg) {
                        while (i < first_extra_arg) {
                                q->h = i;
                                q->key = NULL;
@@ -2050,7 +2050,7 @@ ZEND_FUNCTION(get_defined_constants)
 
 static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array TSRMLS_DC) /* {{{ */
 {
-       uint32_t num_args = call->num_args;
+       uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
 
        array_init_size(arg_array, num_args);
        if (num_args) {
@@ -2063,7 +2063,7 @@ static void debug_backtrace_get_args(zend_execute_data *call, zval *arg_array TS
                        if (call->func->op_array.fn_flags & ZEND_ACC_VARIADIC) {
                                first_extra_arg--;
                        }
-                       if (call->num_args > first_extra_arg) {
+                       if (ZEND_CALL_NUM_ARGS(call) > first_extra_arg) {
                                while (i < first_extra_arg) {
                                        if (Z_REFCOUNTED_P(p)) Z_ADDREF_P(p);
                                        zend_hash_next_index_insert_new(Z_ARRVAL_P(arg_array), p);
index 1e6f0fd9c86d43a354037d24005fa2f3978fa45b..a07fe9f3ddacac62281d4fe39ceaa1ff85c8c7d7 100644 (file)
@@ -373,7 +373,6 @@ struct _zend_execute_data {
        zend_class_entry    *called_scope;
        zend_execute_data   *prev_execute_data;
        uint32_t             frame_info;
-       uint32_t             num_args;
        zval                *return_value;
        zend_array          *symbol_table;
 };
@@ -394,6 +393,9 @@ struct _zend_execute_data {
 #define ZEND_CALL_ARG(call, n) \
        (((zval*)(call)) + ((n) + (ZEND_CALL_FRAME_SLOT - 1)))
 
+#define ZEND_CALL_NUM_ARGS(call) \
+       (call)->This.u2.num_args
+
 #define EX(element)                    ((execute_data)->element)
 
 #define EX_VAR_2(ex, n)                        ((zval*)(((char*)(ex)) + ((int)(n))))
@@ -404,6 +406,8 @@ struct _zend_execute_data {
 
 #define EX_VAR_TO_NUM(n)               (EX_VAR_2(NULL, n) - EX_VAR_NUM_2(NULL, 0))
 
+#define EX_NUM_ARGS()                  ZEND_CALL_NUM_ARGS(execute_data)
+
 #define IS_CONST       (1<<0)
 #define IS_TMP_VAR     (1<<1)
 #define IS_VAR         (1<<2)
index d956a5205bdb680b6cd1f2e0e8fd5d3cdac87572..10f95f90d9ef06ee6c026c02a1c9cb10b8bc4cf4 100644 (file)
@@ -1494,7 +1494,7 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu
        if (UNEXPECTED((op_array->fn_flags & ZEND_ACC_VARIADIC) != 0)) {
                first_extra_arg--;
        }
-       num_args = EX(num_args);
+       num_args = EX_NUM_ARGS();
        if (UNEXPECTED(num_args > first_extra_arg)) {
                zval *end, *src, *dst;
 
@@ -1587,7 +1587,7 @@ static zend_always_inline void i_init_execute_data(zend_execute_data *execute_da
                if (UNEXPECTED((op_array->fn_flags & ZEND_ACC_VARIADIC) != 0)) {
                        first_extra_arg--;
                }
-               num_args = EX(num_args);
+               num_args = EX_NUM_ARGS();
                if (UNEXPECTED(num_args > first_extra_arg)) {
                        zval *end, *src, *dst;
 
@@ -1655,7 +1655,7 @@ ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data
         * restore it simply by replacing a pointer.
         */
        zend_execute_data *execute_data;
-       uint32_t num_args = call->num_args;
+       uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
        size_t stack_size = (ZEND_CALL_FRAME_SLOT + MAX(op_array->last_var + op_array->T, num_args)) * sizeof(zval);
 
        EG(vm_stack) = zend_vm_stack_new_page(
@@ -1673,7 +1673,7 @@ ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data
                call->called_scope,
                Z_OBJ(call->This),
                NULL TSRMLS_CC);
-       EX(num_args) = num_args;
+       EX_NUM_ARGS() = num_args;
 
        /* copy arguments */
        if (num_args > 0) {
index 8a621cf34829d1e423a9cf1092b7dd1f11c8f3e1..0fca6c8a12d8643abae8fd22368ed70d8c0b94df 100644 (file)
@@ -223,7 +223,7 @@ static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(uint3
        call->called_scope = called_scope;
        call->prev_execute_data = prev;
        call->frame_info = frame_info;
-       call->num_args = 0;
+       ZEND_CALL_NUM_ARGS(call) = 0;
        return call;
 }
 
@@ -231,9 +231,9 @@ static zend_always_inline void zend_vm_stack_free_extra_args(zend_execute_data *
 {
        uint32_t first_extra_arg = call->func->op_array.num_args - ((call->func->common.fn_flags & ZEND_ACC_VARIADIC) != 0);
 
-       if (UNEXPECTED(call->num_args > first_extra_arg)) {
+       if (UNEXPECTED(ZEND_CALL_NUM_ARGS(call) > first_extra_arg)) {
                zval *end = EX_VAR_NUM_2(call, call->func->op_array.last_var + call->func->op_array.T);
-               zval *p = end + (call->num_args - first_extra_arg);
+               zval *p = end + (ZEND_CALL_NUM_ARGS(call) - first_extra_arg);
                do {
                        p--;
                        zval_ptr_dtor_nogc(p);
@@ -243,7 +243,7 @@ static zend_always_inline void zend_vm_stack_free_extra_args(zend_execute_data *
 
 static zend_always_inline void zend_vm_stack_free_args(zend_execute_data *call TSRMLS_DC)
 {
-       uint32_t num_args = call->num_args;     
+       uint32_t num_args = ZEND_CALL_NUM_ARGS(call);
 
        if (num_args > 0) {
                zval *end = ZEND_CALL_ARG(call, 1);
index 5b31f465ca96f0e142ebffecaff396ca15e393f6..f0fc7351838f24606a778fe2b6e98d7bc6512eeb 100644 (file)
@@ -787,7 +787,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
                                        !ARG_MAY_BE_SENT_BY_REF(func, i + 1)) {
                                        if (i) {
                                                /* hack to clean up the stack */
-                                               call->num_args = i;
+                                               ZEND_CALL_NUM_ARGS(call) = i;
                                                zend_vm_stack_free_args(call TSRMLS_CC);
                                        }
                                        zend_vm_stack_free_call_frame(call TSRMLS_CC);
@@ -827,7 +827,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
                        ZVAL_COPY(param, &fci->params[i]);
                }
        }
-       call->num_args = fci->param_count;
+       ZEND_CALL_NUM_ARGS(call) = fci->param_count;
 
        EG(scope) = calling_scope;
        if (func->common.fn_flags & ZEND_ACC_STATIC) {
index b07a62668cd99d15bdff9bc49639cc12e298257b..d0b4853e59d5fc2490c72e8e3808f307d56323b4 100644 (file)
@@ -121,6 +121,7 @@ struct _zval_struct {
                uint32_t     next;                 /* hash collision chain */
                uint32_t     cache_slot;           /* literal cache slot */
                uint32_t     lineno;               /* line number (for ast nodes) */
+               uint32_t     num_args;             /* arguments number for EX(This) */
        } u2;
 };
 
index d3791dd0565e88e1a6fcc7b1c89bee702c401d86..e2d2407d8fcf3784d3be6b73816c4c9e4014e3f9 100644 (file)
@@ -2674,7 +2674,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
                        uint32_t i;
                        zval *p = ZEND_CALL_ARG(call, 1);
 
-                       for (i = 0; i < call->num_args; ++i) {
+                       for (i = 0; i < ZEND_CALL_NUM_ARGS(call); ++i) {
                                zend_verify_arg_type(fbc, i + 1, p, NULL TSRMLS_CC);
                                p++;
                        }
@@ -3000,7 +3000,7 @@ ZEND_VM_HANDLER(65, ZEND_SEND_VAL, CONST|TMP, ANY)
        SAVE_OPLINE();
        value = GET_OP1_ZVAL_PTR(BP_VAR_R);
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        ZVAL_COPY_VALUE(arg, value);
        if (OP1_TYPE == IS_CONST) {
                if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -3022,7 +3022,7 @@ ZEND_VM_HANDLER(116, ZEND_SEND_VAL_EX, CONST|TMP, ANY)
        }
        value = GET_OP1_ZVAL_PTR(BP_VAR_R);
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        ZVAL_COPY_VALUE(arg, value);
        if (OP1_TYPE == IS_CONST) {
                if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -3040,7 +3040,7 @@ ZEND_VM_HANDLER(117, ZEND_SEND_VAR, VAR|CV, ANY)
 
        varptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) && Z_ISREF_P(varptr)) {
                ZVAL_COPY(arg, Z_REFVAL_P(varptr));
                FREE_OP1();
@@ -3085,7 +3085,7 @@ ZEND_VM_HANDLER(106, ZEND_SEND_VAR_NO_REF, VAR|CV, ANY)
        }
 
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        ZVAL_COPY_VALUE(arg, varptr);
 
        CHECK_EXCEPTION();
@@ -3106,7 +3106,7 @@ ZEND_VM_HANDLER(67, ZEND_SEND_REF, VAR|CV, ANY)
        }
 
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        if (OP1_TYPE == IS_VAR && UNEXPECTED(varptr == &EG(error_zval))) {
                ZVAL_NEW_REF(arg, &EG(uninitialized_zval));
                ZEND_VM_NEXT_OPCODE();
@@ -3139,7 +3139,7 @@ ZEND_VM_HANDLER(66, ZEND_SEND_VAR_EX, VAR|CV, ANY)
        }
        varptr = GET_OP1_ZVAL_PTR(BP_VAR_R);
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        if ((OP1_TYPE == IS_CV || OP1_TYPE == IS_VAR) && Z_ISREF_P(varptr)) {
                ZVAL_COPY(arg, Z_REFVAL_P(varptr));
                FREE_OP1();
@@ -3161,7 +3161,7 @@ ZEND_VM_HANDLER(165, ZEND_SEND_UNPACK, ANY, ANY)
        SAVE_OPLINE();
 
        args = GET_OP1_ZVAL_PTR(BP_VAR_R);
-       arg_num = EX(call)->num_args + 1;
+       arg_num = ZEND_CALL_NUM_ARGS(EX(call)) + 1;
 
 ZEND_VM_C_LABEL(send_again):
        switch (Z_TYPE_P(args)) {
@@ -3212,7 +3212,7 @@ ZEND_VM_C_LABEL(send_again):
                                        ZVAL_COPY(top, arg);
                                }
 
-                               EX(call)->num_args++;
+                               ZEND_CALL_NUM_ARGS(EX(call))++;
                                arg_num++;
                        } ZEND_HASH_FOREACH_END();
 
@@ -3293,7 +3293,7 @@ ZEND_VM_C_LABEL(send_again):
                                zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, 1 TSRMLS_CC);
                                top = ZEND_CALL_ARG(EX(call), arg_num);
                                ZVAL_COPY_VALUE(top, arg);
-                               EX(call)->num_args++;
+                               ZEND_CALL_NUM_ARGS(EX(call))++;
 
                                iter->funcs->move_forward(iter TSRMLS_CC);
                                if (UNEXPECTED(EG(exception) != NULL)) {
@@ -3425,7 +3425,7 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY)
                        } else {
                                ZVAL_COPY(param, arg);
                        }
-                       EX(call)->num_args++;
+                       ZEND_CALL_NUM_ARGS(EX(call))++;
                        arg_num++;
                        param++;
                } ZEND_HASH_FOREACH_END();
@@ -3507,7 +3507,7 @@ ZEND_VM_HANDLER(120, ZEND_SEND_USER, VAR|CV, ANY)
                ZVAL_COPY(param, arg);
        }
 
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
 
        FREE_OP1();
        CHECK_EXCEPTION();
@@ -3520,7 +3520,7 @@ ZEND_VM_HANDLER(63, ZEND_RECV, ANY, ANY)
        uint32_t arg_num = opline->op1.num;
 
        SAVE_OPLINE();
-       if (UNEXPECTED(arg_num > EX(num_args))) {
+       if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
                zend_verify_missing_arg(execute_data, arg_num TSRMLS_CC);
                CHECK_EXCEPTION();
        } else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
@@ -3541,7 +3541,7 @@ ZEND_VM_HANDLER(64, ZEND_RECV_INIT, ANY, CONST)
 
        SAVE_OPLINE();
        param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
-       if (arg_num > EX(num_args)) {
+       if (arg_num > EX_NUM_ARGS()) {
                ZVAL_COPY_VALUE(param, opline->op2.zv);
                if (Z_OPT_CONSTANT_P(param)) {
                        zval_update_constant(param, 0 TSRMLS_CC);
@@ -3565,7 +3565,7 @@ ZEND_VM_HANDLER(164, ZEND_RECV_VARIADIC, ANY, ANY)
 {
        USE_OPLINE
        uint32_t arg_num = opline->op1.num;
-       uint32_t arg_count = EX(num_args);
+       uint32_t arg_count = EX_NUM_ARGS();
        zval *params;
 
        SAVE_OPLINE();
index d427ed1aad04dc707da8cc2f01cf96c0f9e04a36..671049d71d9aca5d9ef2c0038a2e992531981ac0 100644 (file)
@@ -537,7 +537,7 @@ static int ZEND_FASTCALL  ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
                        uint32_t i;
                        zval *p = ZEND_CALL_ARG(call, 1);
 
-                       for (i = 0; i < call->num_args; ++i) {
+                       for (i = 0; i < ZEND_CALL_NUM_ARGS(call); ++i) {
                                zend_verify_arg_type(fbc, i + 1, p, NULL TSRMLS_CC);
                                p++;
                        }
@@ -692,7 +692,7 @@ static int ZEND_FASTCALL  ZEND_SEND_UNPACK_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS
        SAVE_OPLINE();
 
        args = get_zval_ptr(opline->op1_type, &opline->op1, execute_data, &free_op1, BP_VAR_R);
-       arg_num = EX(call)->num_args + 1;
+       arg_num = ZEND_CALL_NUM_ARGS(EX(call)) + 1;
 
 send_again:
        switch (Z_TYPE_P(args)) {
@@ -743,7 +743,7 @@ send_again:
                                        ZVAL_COPY(top, arg);
                                }
 
-                               EX(call)->num_args++;
+                               ZEND_CALL_NUM_ARGS(EX(call))++;
                                arg_num++;
                        } ZEND_HASH_FOREACH_END();
 
@@ -824,7 +824,7 @@ send_again:
                                zend_vm_stack_extend_call_frame(&EX(call), arg_num - 1, 1 TSRMLS_CC);
                                top = ZEND_CALL_ARG(EX(call), arg_num);
                                ZVAL_COPY_VALUE(top, arg);
-                               EX(call)->num_args++;
+                               ZEND_CALL_NUM_ARGS(EX(call))++;
 
                                iter->funcs->move_forward(iter TSRMLS_CC);
                                if (UNEXPECTED(EG(exception) != NULL)) {
@@ -956,7 +956,7 @@ static int ZEND_FASTCALL  ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
                        } else {
                                ZVAL_COPY(param, arg);
                        }
-                       EX(call)->num_args++;
+                       ZEND_CALL_NUM_ARGS(EX(call))++;
                        arg_num++;
                        param++;
                } ZEND_HASH_FOREACH_END();
@@ -972,7 +972,7 @@ static int ZEND_FASTCALL  ZEND_RECV_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
        uint32_t arg_num = opline->op1.num;
 
        SAVE_OPLINE();
-       if (UNEXPECTED(arg_num > EX(num_args))) {
+       if (UNEXPECTED(arg_num > EX_NUM_ARGS())) {
                zend_verify_missing_arg(execute_data, arg_num TSRMLS_CC);
                CHECK_EXCEPTION();
        } else if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) != 0)) {
@@ -989,7 +989,7 @@ static int ZEND_FASTCALL  ZEND_RECV_VARIADIC_SPEC_HANDLER(ZEND_OPCODE_HANDLER_AR
 {
        USE_OPLINE
        uint32_t arg_num = opline->op1.num;
-       uint32_t arg_count = EX(num_args);
+       uint32_t arg_count = EX_NUM_ARGS();
        zval *params;
 
        SAVE_OPLINE();
@@ -1664,7 +1664,7 @@ static int ZEND_FASTCALL  ZEND_RECV_INIT_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_
 
        SAVE_OPLINE();
        param = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->result.var TSRMLS_CC);
-       if (arg_num > EX(num_args)) {
+       if (arg_num > EX_NUM_ARGS()) {
                ZVAL_COPY_VALUE(param, opline->op2.zv);
                if (Z_OPT_CONSTANT_P(param)) {
                        zval_update_constant(param, 0 TSRMLS_CC);
@@ -2688,7 +2688,7 @@ static int ZEND_FASTCALL  ZEND_SEND_VAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLER_A
        SAVE_OPLINE();
        value = opline->op1.zv;
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        ZVAL_COPY_VALUE(arg, value);
        if (IS_CONST == IS_CONST) {
                if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -2710,7 +2710,7 @@ static int ZEND_FASTCALL  ZEND_SEND_VAL_EX_SPEC_CONST_HANDLER(ZEND_OPCODE_HANDLE
        }
        value = opline->op1.zv;
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        ZVAL_COPY_VALUE(arg, value);
        if (IS_CONST == IS_CONST) {
                if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -9719,7 +9719,7 @@ static int ZEND_FASTCALL  ZEND_SEND_VAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_ARG
        SAVE_OPLINE();
        value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        ZVAL_COPY_VALUE(arg, value);
        if (IS_TMP_VAR == IS_CONST) {
                if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -9741,7 +9741,7 @@ static int ZEND_FASTCALL  ZEND_SEND_VAL_EX_SPEC_TMP_HANDLER(ZEND_OPCODE_HANDLER_
        }
        value = _get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1);
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        ZVAL_COPY_VALUE(arg, value);
        if (IS_TMP_VAR == IS_CONST) {
                if (UNEXPECTED(Z_OPT_COPYABLE_P(arg))) {
@@ -16482,7 +16482,7 @@ static int ZEND_FASTCALL  ZEND_SEND_VAR_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
 
        varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && Z_ISREF_P(varptr)) {
                ZVAL_COPY(arg, Z_REFVAL_P(varptr));
                zval_ptr_dtor_nogc(free_op1);
@@ -16527,7 +16527,7 @@ static int ZEND_FASTCALL  ZEND_SEND_VAR_NO_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
        }
 
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        ZVAL_COPY_VALUE(arg, varptr);
 
        CHECK_EXCEPTION();
@@ -16548,7 +16548,7 @@ static int ZEND_FASTCALL  ZEND_SEND_REF_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_ARG
        }
 
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        if (IS_VAR == IS_VAR && UNEXPECTED(varptr == &EG(error_zval))) {
                ZVAL_NEW_REF(arg, &EG(uninitialized_zval));
                ZEND_VM_NEXT_OPCODE();
@@ -16581,7 +16581,7 @@ static int ZEND_FASTCALL  ZEND_SEND_VAR_EX_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_
        }
        varptr = _get_zval_ptr_var(opline->op1.var, execute_data, &free_op1);
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        if ((IS_VAR == IS_CV || IS_VAR == IS_VAR) && Z_ISREF_P(varptr)) {
                ZVAL_COPY(arg, Z_REFVAL_P(varptr));
                zval_ptr_dtor_nogc(free_op1);
@@ -16666,7 +16666,7 @@ static int ZEND_FASTCALL  ZEND_SEND_USER_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
                ZVAL_COPY(param, arg);
        }
 
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
 
        zval_ptr_dtor_nogc(free_op1);
        CHECK_EXCEPTION();
@@ -34276,7 +34276,7 @@ static int ZEND_FASTCALL  ZEND_SEND_VAR_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
 
        varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(varptr)) {
                ZVAL_COPY(arg, Z_REFVAL_P(varptr));
 
@@ -34321,7 +34321,7 @@ static int ZEND_FASTCALL  ZEND_SEND_VAR_NO_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
        }
 
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        ZVAL_COPY_VALUE(arg, varptr);
 
        CHECK_EXCEPTION();
@@ -34342,7 +34342,7 @@ static int ZEND_FASTCALL  ZEND_SEND_REF_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARGS
        }
 
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        if (IS_CV == IS_VAR && UNEXPECTED(varptr == &EG(error_zval))) {
                ZVAL_NEW_REF(arg, &EG(uninitialized_zval));
                ZEND_VM_NEXT_OPCODE();
@@ -34374,7 +34374,7 @@ static int ZEND_FASTCALL  ZEND_SEND_VAR_EX_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_A
        }
        varptr = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op1.var TSRMLS_CC);
        arg = ZEND_CALL_ARG(EX(call), opline->op2.num);
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
        if ((IS_CV == IS_CV || IS_CV == IS_VAR) && Z_ISREF_P(varptr)) {
                ZVAL_COPY(arg, Z_REFVAL_P(varptr));
 
@@ -34458,7 +34458,7 @@ static int ZEND_FASTCALL  ZEND_SEND_USER_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
                ZVAL_COPY(param, arg);
        }
 
-       EX(call)->num_args = opline->op2.num;
+       ZEND_CALL_NUM_ARGS(EX(call)) = opline->op2.num;
 
        CHECK_EXCEPTION();
        ZEND_VM_NEXT_OPCODE();