]> granicus.if.org Git - php/commitdiff
Replaced EG(This) and EX(object) with EX(This).
authorDmitry Stogov <dmitry@zend.com>
Fri, 3 Oct 2014 15:32:46 +0000 (19:32 +0400)
committerDmitry Stogov <dmitry@zend.com>
Fri, 3 Oct 2014 15:32:46 +0000 (19:32 +0400)
Internal functions now recieves zend_execute_data as the first argument.

26 files changed:
Zend/zend.h
Zend/zend_API.c
Zend/zend_API.h
Zend/zend_builtin_functions.c
Zend/zend_closures.c
Zend/zend_compile.h
Zend/zend_execute.c
Zend/zend_execute.h
Zend/zend_execute_API.c
Zend/zend_generators.c
Zend/zend_globals.h
Zend/zend_object_handlers.c
Zend/zend_types.h
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
Zend/zend_vm_execute.skl
Zend/zend_vm_gen.php
ext/com_dotnet/com_com.c
ext/com_dotnet/com_handlers.c
ext/pdo/pdo_dbh.c
ext/reflection/php_reflection.c
ext/soap/soap.c
ext/spl/php_spl.c
ext/spl/spl_directory.c
ext/standard/basic_functions.c
ext/standard/formatted_print.c

index 517d41966528cc877e12dd48a23b353f3d5297d0..969fa5e71beee31560b18ac86bba591bf58a7f61 100644 (file)
 # define HANDLE_UNBLOCK_INTERRUPTIONS()                ZEND_SIGNAL_UNBLOCK_INTERRUPTIONS()
 #endif
 
-#define INTERNAL_FUNCTION_PARAMETERS uint32_t param_count, zval *return_value TSRMLS_DC
-#define INTERNAL_FUNCTION_PARAM_PASSTHRU param_count, return_value TSRMLS_CC
+#define INTERNAL_FUNCTION_PARAMETERS zend_execute_data *execute_data, zval *return_value TSRMLS_DC
+#define INTERNAL_FUNCTION_PARAM_PASSTHRU execute_data, return_value TSRMLS_CC
 
 #define USED_RET() \
-       (!EG(current_execute_data) || \
-        !EG(current_execute_data)->prev_execute_data || \
-        !ZEND_USER_CODE(EG(current_execute_data)->prev_execute_data->func->common.type) || \
-        !(EG(current_execute_data)->prev_execute_data->opline->result_type & EXT_TYPE_UNUSED))
+       (!EX(prev_execute_data) || \
+        !ZEND_USER_CODE(EX(prev_execute_data)->func->common.type) || \
+        !(EX(prev_execute_data)->opline->result_type & EXT_TYPE_UNUSED))
 
 #ifdef HAVE_NORETURN
 # if defined(ZEND_WIN32)
index 7c062a107e956eb7aa2bbcdf21fa7ea36beef2b9..b965d209916f51da6aa6a95d0f550a323dca8f85 100644 (file)
@@ -2854,8 +2854,8 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache
                } else {
                        fcc->called_scope = EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL;
                        fcc->calling_scope = EG(scope);
-                       if (!fcc->object && Z_OBJ(EG(This))) {
-                               fcc->object = Z_OBJ(EG(This));
+                       if (!fcc->object && EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This)) {
+                               fcc->object = Z_OBJ(EG(current_execute_data)->This);
                        }
                        ret = 1;
                }
@@ -2867,8 +2867,8 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache
                } else {
                        fcc->called_scope = EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL;
                        fcc->calling_scope = EG(scope)->parent;
-                       if (!fcc->object && Z_OBJ(EG(This))) {
-                               fcc->object = Z_OBJ(EG(This));
+                       if (!fcc->object && EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This)) {
+                               fcc->object = Z_OBJ(EG(current_execute_data)->This);
                        }
                        *strict_class = 1;
                        ret = 1;
@@ -2879,8 +2879,8 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache
                } else {
                        fcc->called_scope = EG(current_execute_data)->called_scope;
                        fcc->calling_scope = EG(current_execute_data)->called_scope;
-                       if (!fcc->object && Z_OBJ(EG(This))) {
-                               fcc->object = Z_OBJ(EG(This));
+                       if (!fcc->object && Z_OBJ(EG(current_execute_data)->This)) {
+                               fcc->object = Z_OBJ(EG(current_execute_data)->This);
                        }
                        *strict_class = 1;
                        ret = 1;
@@ -2894,11 +2894,11 @@ static int zend_is_callable_check_class(zend_string *name, zend_fcall_info_cache
                }
                scope = ex ? ex->func->common.scope : NULL;
                fcc->calling_scope = ce;
-               if (scope && !fcc->object && Z_OBJ(EG(This)) &&
-                   instanceof_function(Z_OBJCE(EG(This)), scope TSRMLS_CC) &&
+               if (scope && !fcc->object && EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This) &&
+                   instanceof_function(Z_OBJCE(EG(current_execute_data)->This), scope TSRMLS_CC) &&
                    instanceof_function(scope, fcc->calling_scope TSRMLS_CC)) {
-                       fcc->object = Z_OBJ(EG(This));
-                       fcc->called_scope = Z_OBJCE(EG(This));
+                       fcc->object = Z_OBJ(EG(current_execute_data)->This);
+                       fcc->called_scope = Z_OBJCE(EG(current_execute_data)->This);
                } else {
                        fcc->called_scope = fcc->object ? zend_get_class_entry(fcc->object TSRMLS_CC) : fcc->calling_scope;
                }
@@ -3099,10 +3099,10 @@ get_function_via_handler:
                        if (fcc->function_handler) {
                                retval = 1;
                                call_via_handler = (fcc->function_handler->common.fn_flags & ZEND_ACC_CALL_VIA_HANDLER) != 0;
-                               if (call_via_handler && !fcc->object && Z_OBJ(EG(This)) &&
-                                   Z_OBJ_HT(EG(This))->get_class_entry &&
-                                   instanceof_function(Z_OBJCE(EG(This)), fcc->calling_scope TSRMLS_CC)) {
-                                       fcc->object = Z_OBJ(EG(This));
+                               if (call_via_handler && !fcc->object && EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This) &&
+                                   Z_OBJ_HT(EG(current_execute_data)->This)->get_class_entry &&
+                                   instanceof_function(Z_OBJCE(EG(current_execute_data)->This), fcc->calling_scope TSRMLS_CC)) {
+                                       fcc->object = Z_OBJ(EG(current_execute_data)->This);
                                }
                        }
                }
@@ -3131,15 +3131,15 @@ get_function_via_handler:
                                if ((check_flags & IS_CALLABLE_CHECK_IS_STATIC) != 0) {
                                        retval = 0;
                                }
-                               if (Z_OBJ(EG(This)) && instanceof_function(Z_OBJCE(EG(This)), fcc->calling_scope TSRMLS_CC)) {
-                                       fcc->object = Z_OBJ(EG(This));
+                               if (EG(current_execute_data) && Z_OBJ(EG(current_execute_data)->This) && instanceof_function(Z_OBJCE(EG(current_execute_data)->This), fcc->calling_scope TSRMLS_CC)) {
+                                       fcc->object = Z_OBJ(EG(current_execute_data)->This);
                                        if (error) {
-                                               zend_spprintf(error, 0, "non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb, Z_OBJCE(EG(This))->name->val);
+                                               zend_spprintf(error, 0, "non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb, Z_OBJCE(EG(current_execute_data)->This)->name->val);
                                                if (severity == E_ERROR) {
                                                        retval = 0;
                                                }
                                        } else if (retval) {
-                                               zend_error(severity, "Non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb, Z_OBJCE(EG(This))->name->val);
+                                               zend_error(severity, "Non-static method %s::%s() %s be called statically, assuming $this from compatible context %s", fcc->calling_scope->name->val, fcc->function_handler->common.function_name->val, verb, Z_OBJCE(EG(current_execute_data)->This)->name->val);
                                        }
                                } else {
                                        if (error) {
@@ -4147,6 +4147,39 @@ ZEND_API zend_string *zend_resolve_method_name(zend_class_entry *ce, zend_functi
 }
 /* }}} */
 
+ZEND_API void zend_ctor_make_null(zend_execute_data *execute_data) /* {{{ */
+{
+       if (EX(return_value)) {
+/*
+               if (Z_TYPE_P(EX(return_value)) == IS_OBJECT) {
+                       zend_object *object = Z_OBJ_P(EX(return_value));
+                       zend_execute_data *ex = EX(prev_execute_data);
+                       
+                       while (ex && Z_OBJ(ex->This) == object) {
+                               if (ex->func) {
+                                       if (ZEND_USER_CODE(ex->func->type)) {
+                                               if (ex->func->op_array.this_var != -1) {
+                                                       zval *this_var = EX_VAR_2(ex, ex->func->op_array.this_var);
+                                                       if (this_var != EX(return_value)) {
+                                                               zval_ptr_dtor(this_var);
+                                                               ZVAL_NULL(this_var);
+                                                       }
+                                               }
+                                       }
+                               }
+                               Z_OBJ(ex->This) = NULL;
+                               ZVAL_NULL(&ex->This);
+                               ex = ex->prev_execute_data;
+                       }
+               }
+*/
+               zval_ptr_dtor(EX(return_value));
+               Z_OBJ_P(EX(return_value)) = NULL;
+               ZVAL_NULL(EX(return_value));
+       }
+}
+/* }}} */
+
 /*
  * Local variables:
  * tab-width: 4
index 657d1d04de622f69e5b1d0fd242ea0b988069245..730e1b9e14dc5f9f54965049df32934f864aaf18 100644 (file)
@@ -343,12 +343,12 @@ ZEND_API zend_class_entry *zend_get_class_entry(const zend_object *object TSRMLS
 ZEND_API zend_string *zend_get_object_classname(const zend_object *object TSRMLS_DC);
 ZEND_API char *zend_get_type_by_const(int type);
 
-#define getThis() (Z_OBJ(EG(This)) ? &EG(This) : NULL)
+#define getThis()                                                      (Z_OBJ(EX(This)) ? &EX(This) : NULL)
 
 #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)       (param_count)
-#define ZEND_NUM_ARGS()                (param_count)
+#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; }
 
@@ -531,6 +531,8 @@ ZEND_API int zend_set_local_var_str(const char *name, int len, zval *value, int
 ZEND_API zend_string *zend_find_alias_name(zend_class_entry *ce, zend_string *name);
 ZEND_API zend_string *zend_resolve_method_name(zend_class_entry *ce, zend_function *f);
 
+ZEND_API void zend_ctor_make_null(zend_execute_data *execute_data);
+
 #define add_method(arg, key, method)   add_assoc_function((arg), (key), (method))
 
 ZEND_API ZEND_FUNCTION(display_disabled_function);
@@ -639,26 +641,8 @@ END_EXTERN_C()
 } while (0)
 
 /* May be used in internal constructors to make them return NULL */
-#if 1 // support for directly called constructors only ???
-#define ZEND_CTOR_MAKE_NULL() do {                                                                             \
-               if (EG(current_execute_data)->return_value) {                                   \
-                       zval_ptr_dtor(EG(current_execute_data)->return_value);          \
-                       ZVAL_NULL(EG(current_execute_data)->return_value);                      \
-               } \
-       } while (0)
-#else // attempt to support calls to parent::__construct() ???
-         // see: ext/date/tests/bug67118.phpt
-#define ZEND_CTOR_MAKE_NULL() do {                                                                             \
-               if (EG(current_execute_data)->return_value) {                                   \
-                       zval_ptr_dtor(EG(current_execute_data)->return_value);          \
-                       ZVAL_NULL(EG(current_execute_data)->return_value);                      \
-               } else if (EG(current_execute_data)->prev_execute_data &&               \
-                       EG(current_execute_data)->prev_execute_data->object ==          \
-                               EG(current_execute_data)->object) {                                             \
-                       EG(current_execute_data)->prev_execute_data->object = NULL;     \
-               } \
-       } while (0)
-#endif
+#define ZEND_CTOR_MAKE_NULL() \
+       zend_ctor_make_null(execute_data)
 
 #define RETURN_ZVAL_FAST(z) { RETVAL_ZVAL_FAST(z); return; }
 
@@ -729,7 +713,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 = EG(current_execute_data)->num_args; \
+               int _num_args = EX(num_args); \
                int _i; \
                zval *_real_arg, *_arg = NULL; \
                zend_expected_type _expected_type = IS_UNDEF; \
@@ -756,7 +740,7 @@ ZEND_API int _z_param_class(zval *arg, zend_class_entry **pce, int num, int chec
                                break; \
                        } \
                        _i = 0; \
-                       _real_arg = ZEND_CALL_ARG(EG(current_execute_data), 0);
+                       _real_arg = ZEND_CALL_ARG(execute_data, 0);
 
 #define ZEND_PARSE_PARAMETERS_START(min_num_args, max_num_args) \
        ZEND_PARSE_PARAMETERS_START_EX(0, min_num_args, max_num_args)
index 03a148a473a6219778fb8c785224072614d710da..728d90acdf4c92133505f08d4da96d541237baae 100644 (file)
@@ -400,7 +400,7 @@ ZEND_FUNCTION(gc_disable)
    Get the number of arguments that were passed to the function */
 ZEND_FUNCTION(func_num_args)
 {
-       zend_execute_data *ex = EG(current_execute_data)->prev_execute_data;
+       zend_execute_data *ex = EX(prev_execute_data);
 
        if (ex->frame_kind == VM_FRAME_NESTED_FUNCTION || ex->frame_kind == VM_FRAME_TOP_FUNCTION) {
                RETURN_LONG(ex->num_args);
@@ -429,7 +429,7 @@ ZEND_FUNCTION(func_get_arg)
                RETURN_FALSE;
        }
 
-       ex = EG(current_execute_data)->prev_execute_data;
+       ex = EX(prev_execute_data);
        if (ex->frame_kind != VM_FRAME_NESTED_FUNCTION && ex->frame_kind != VM_FRAME_TOP_FUNCTION) {
                zend_error(E_WARNING, "func_get_arg():  Called from the global scope - no function context");
                RETURN_FALSE;
@@ -462,7 +462,7 @@ ZEND_FUNCTION(func_get_args)
        zval *p;
        uint32_t arg_count, first_extra_arg;
        uint32_t i;
-       zend_execute_data *ex = EG(current_execute_data)->prev_execute_data;
+       zend_execute_data *ex = EX(prev_execute_data);
 
        if (ex->frame_kind != VM_FRAME_NESTED_FUNCTION && ex->frame_kind != VM_FRAME_TOP_FUNCTION) {
                zend_error(E_WARNING, "func_get_args():  Called from the global scope - no function context");
@@ -823,8 +823,8 @@ ZEND_FUNCTION(get_called_class)
                return;
        }
 
-       if (EG(current_execute_data)->called_scope) {
-               RETURN_STR(zend_string_copy(EG(current_execute_data)->called_scope->name));
+       if (EX(called_scope)) {
+               RETURN_STR(zend_string_copy(EX(called_scope)->name));
        } else if (!EG(scope))  {
                zend_error(E_WARNING, "get_called_class() called from outside a class");
        }
@@ -2132,7 +2132,7 @@ ZEND_FUNCTION(debug_print_backtrace)
        }
 
        ZVAL_UNDEF(&arg_array);
-       ptr = EG(current_execute_data)->prev_execute_data;
+       ptr = EX(prev_execute_data);
 
        /* skip debug_backtrace() */
        call = ptr;
@@ -2172,7 +2172,7 @@ ZEND_FUNCTION(debug_print_backtrace)
                }
 
                /* $this may be passed into regular internal functions */
-               object = call->object;
+               object = Z_OBJ(call->This);
                if (object &&
                        call &&
                    call->func->type == ZEND_INTERNAL_FUNCTION &&
@@ -2394,7 +2394,7 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int
                }
 
                /* $this may be passed into regular internal functions */
-               object = call ? call->object : NULL;
+               object = call ? Z_OBJ(call->This) : NULL;
                if (object &&
                    call->func &&
                    call->func->type == ZEND_INTERNAL_FUNCTION &&
index cab31ce1c09ee6f0f5e3560f3e9e6fc026c15c28..90d7a6bb866c521f9977e0f341b0859aeadc33bc 100644 (file)
@@ -47,7 +47,7 @@ static zend_object_handlers closure_handlers;
 
 ZEND_METHOD(Closure, __invoke) /* {{{ */
 {
-       zend_function *func = EG(current_execute_data)->func;
+       zend_function *func = EX(func);
        zval *arguments;
 
        arguments = emalloc(sizeof(zval) * ZEND_NUM_ARGS());
index cf1256ab3c779d1a2495c2aad419d6ebf3ec17cd..2594495c9692432b33dbb41dc66ecbb8d419f63d 100644 (file)
@@ -100,8 +100,6 @@ void zend_compile_var(znode *node, zend_ast *ast, uint32_t type TSRMLS_DC);
 void zend_eval_const_expr(zend_ast **ast_ptr TSRMLS_DC);
 void zend_const_expr_to_zval(zval *result, zend_ast *ast TSRMLS_DC);
 
-typedef struct _zend_execute_data zend_execute_data;
-
 #define ZEND_OPCODE_HANDLER_ARGS zend_execute_data *execute_data TSRMLS_DC
 #define ZEND_OPCODE_HANDLER_ARGS_PASSTHRU execute_data TSRMLS_CC
 
@@ -366,7 +364,7 @@ struct _zend_execute_data {
        zend_uchar           flags;
        zend_uchar           frame_kind;
        zend_class_entry    *called_scope;
-       zend_object         *object;
+       zval                 This;
        zend_execute_data   *prev_execute_data;
        zval                *return_value;
        zend_class_entry    *scope;            /* function scope (self)          */
@@ -385,7 +383,7 @@ struct _zend_execute_data {
 #define ZEND_CALL_ARG(call, n) \
        (((zval*)(call)) + ((n) + (ZEND_CALL_FRAME_SLOT - 1)))
 
-#define EX(element) execute_data.element
+#define EX(element)                    ((execute_data)->element)
 
 #define EX_VAR_2(ex, n)                        ((zval*)(((char*)(ex)) + ((int)(n))))
 #define EX_VAR_NUM_2(ex, n)     (((zval*)(ex)) + (ZEND_CALL_FRAME_SLOT + ((int)(n))))
index 012e2f5aceca82307d4bd444009364a4812ae548..e019191a5e1294152e374306b22b0eea8a292759 100644 (file)
@@ -123,9 +123,6 @@ static const zend_internal_function zend_pass_function = {
 #define DECODE_CTOR(ce) \
        ((zend_class_entry*)(((zend_uintptr_t)(ce)) & ~(CTOR_CALL_BIT|CTOR_USED_BIT)))
 
-#undef EX
-#define EX(element) execute_data->element
-
 ZEND_API zval* zend_get_compiled_variable_value(const zend_execute_data *execute_data, uint32_t var)
 {
        return EX_VAR(var);
@@ -426,22 +423,22 @@ static inline zval *_get_zval_ptr_ptr(int op_type, const znode_op *node, const z
        }
 }
 
-static zend_always_inline zval *_get_obj_zval_ptr_unused(TSRMLS_D)
+static zend_always_inline zval *_get_obj_zval_ptr_unused(zend_execute_data *execute_data TSRMLS_DC)
 {
-       if (EXPECTED(Z_OBJ(EG(This)) != NULL)) {
-               return &EG(This);
+       if (EXPECTED(Z_OBJ(EX(This)) != NULL)) {
+               return &EX(This);
        } else {
                zend_error_noreturn(E_ERROR, "Using $this when not in object context");
                return NULL;
        }
 }
 
-static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
+static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
 {
        if (op_type == IS_UNUSED) {
-               if (EXPECTED(Z_OBJ(EG(This)) != NULL)) {
+               if (EXPECTED(Z_OBJ(EX(This)) != NULL)) {
                        should_free->var = NULL;
-                       return &EG(This);
+                       return &EX(This);
                } else {
                        zend_error_noreturn(E_ERROR, "Using $this when not in object context");
                }
@@ -449,12 +446,12 @@ static inline zval *_get_obj_zval_ptr(int op_type, znode_op *op, const zend_exec
        return get_zval_ptr(op_type, op, execute_data, should_free, type);
 }
 
-static inline zval *_get_obj_zval_ptr_ptr(int op_type, const znode_op *node, const zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
+static inline zval *_get_obj_zval_ptr_ptr(int op_type, const znode_op *node, zend_execute_data *execute_data, zend_free_op *should_free, int type TSRMLS_DC)
 {
        if (op_type == IS_UNUSED) {
-               if (EXPECTED(Z_OBJ(EG(This)) != NULL)) {
+               if (EXPECTED(Z_OBJ(EX(This)) != NULL)) {
                        should_free->var = NULL;
-                       return &EG(This);
+                       return &EX(This);
                } else {
                        zend_error_noreturn(E_ERROR, "Using $this when not in object context");
                }
@@ -1367,7 +1364,7 @@ ZEND_API opcode_handler_t *zend_opcode_handlers;
 
 ZEND_API void execute_internal(zend_execute_data *execute_data, zval *return_value TSRMLS_DC)
 {
-       execute_data->func->internal_function.handler(execute_data->num_args, return_value TSRMLS_CC);
+       execute_data->func->internal_function.handler(execute_data, return_value TSRMLS_CC);
 }
 
 void zend_clean_and_cache_symbol_table(zend_array *symbol_table TSRMLS_DC) /* {{{ */
@@ -1427,7 +1424,6 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu
 {
        uint32_t first_extra_arg, num_args;
        ZEND_ASSERT(EX(func) == (zend_function*)op_array);
-       ZEND_ASSERT(EX(object) == Z_OBJ(EG(This)));
 
        EX(opline) = op_array->opcodes;
        EX(call) = NULL;
@@ -1479,9 +1475,9 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu
                } while (var != end);
        }
 
-       if (op_array->this_var != -1 && EX(object)) {
-               ZVAL_OBJ(EX_VAR(op_array->this_var), EX(object));
-               GC_REFCOUNT(EX(object))++;
+       if (op_array->this_var != -1 && Z_OBJ(EX(This))) {
+               ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This)));
+               GC_REFCOUNT(Z_OBJ(EX(This)))++;
        }
 
        if (!op_array->run_time_cache && op_array->last_cache_slot) {
@@ -1496,7 +1492,6 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu
 static zend_always_inline void i_init_code_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value, vm_frame_kind frame_kind TSRMLS_DC) /* {{{ */
 {
        ZEND_ASSERT(EX(func) == (zend_function*)op_array);
-       ZEND_ASSERT(EX(object) == Z_OBJ(EG(This)));
 
        EX(opline) = op_array->opcodes;
        EX(call) = NULL;
@@ -1520,7 +1515,6 @@ static zend_always_inline void i_init_code_execute_data(zend_execute_data *execu
 static zend_always_inline void i_init_execute_data(zend_execute_data *execute_data, zend_op_array *op_array, zval *return_value, vm_frame_kind frame_kind TSRMLS_DC) /* {{{ */
 {
        ZEND_ASSERT(EX(func) == (zend_function*)op_array);
-       ZEND_ASSERT(EX(object) == Z_OBJ(EG(This)));
 
        EX(opline) = op_array->opcodes;
        EX(call) = NULL;
@@ -1577,9 +1571,9 @@ static zend_always_inline void i_init_execute_data(zend_execute_data *execute_da
                        } while (var != end);
                }
 
-               if (op_array->this_var != -1 && EX(object)) {
-                       ZVAL_OBJ(EX_VAR(op_array->this_var), EX(object));
-                       GC_REFCOUNT(EX(object))++;
+               if (op_array->this_var != -1 && Z_OBJ(EX(This))) {
+                       ZVAL_OBJ(EX_VAR(op_array->this_var), Z_OBJ(EX(This)));
+                       GC_REFCOUNT(Z_OBJ(EX(This)))++;
                }
        }
 
@@ -1622,7 +1616,7 @@ ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data
                num_args,
                call->flags,
                call->called_scope,
-               call->object,
+               Z_OBJ(call->This),
                NULL TSRMLS_CC);
        EX(num_args) = num_args;
 
index ce01e51d3f5270008f78984825234b39ba3901fc..3770f4cbe9c24cdb52c5751c5841670111fe7a9d 100644 (file)
@@ -218,7 +218,7 @@ static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(zend_
        call->num_args = 0;
        call->flags = flags;
        call->called_scope = called_scope;
-       call->object = object;
+       ZVAL_OBJ(&call->This, object);
        call->prev_execute_data = prev;
        return call;
 }
index b528bd0ab5f89936f29d034856fa5885e27af231..9fdb2ee4f5e3363417a862fb91d9d5ffa0ee63de 100644 (file)
@@ -187,8 +187,6 @@ void init_executor(TSRMLS_D) /* {{{ */
 
        EG(scope) = NULL;
 
-       ZVAL_OBJ(&EG(This), NULL);
-
        EG(active) = 1;
 }
 /* }}} */
@@ -663,7 +661,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
        zend_execute_data *call, dummy_execute_data;
        zend_fcall_info_cache fci_cache_local;
        zend_function *func;
-       zend_object *orig_object;
        zend_class_entry *orig_scope;
        zval tmp;
 
@@ -685,7 +682,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
                        break;
        }
 
-       orig_object = Z_OBJ(EG(This));
        orig_scope = EG(scope);
 
        /* Initialize execute_data */
@@ -835,10 +831,11 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
        EG(scope) = calling_scope;
        if (!fci->object ||
            (func->common.fn_flags & ZEND_ACC_STATIC)) {
-               Z_OBJ(EG(This)) = call->object = NULL;
+               Z_OBJ(call->This) = NULL;
+               Z_TYPE_INFO(call->This) = IS_UNDEF;
        } else {
-               Z_OBJ(EG(This)) = fci->object;
-               Z_ADDREF(EG(This));
+               ZVAL_OBJ(&call->This, fci->object);
+               GC_REFCOUNT(fci->object)++;
        }
 
        if (func->type == ZEND_USER_FUNCTION) {
@@ -861,7 +858,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
                EG(current_execute_data) = call;
                if (EXPECTED(zend_execute_internal == NULL)) {
                        /* saves one function call if zend_execute_internal is not used */
-                       func->internal_function.handler(fci->param_count, fci->retval TSRMLS_CC);
+                       func->internal_function.handler(call, fci->retval TSRMLS_CC);
                } else {
                        zend_execute_internal(call, fci->retval TSRMLS_CC);
                }
@@ -891,7 +888,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
                if (fci->object) {
                        call->prev_execute_data = EG(current_execute_data);
                        EG(current_execute_data) = call;
-                       fci->object->handlers->call_method(func->common.function_name, fci->object, fci->param_count, fci->retval TSRMLS_CC);
+                       fci->object->handlers->call_method(func->common.function_name, fci->object, call, fci->retval TSRMLS_CC);
                        EG(current_execute_data) = call->prev_execute_data;
                } else {
                        zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object");
@@ -911,11 +908,10 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
                }
        }
 
-       if (Z_OBJ(EG(This))) {
-               zval_ptr_dtor(&EG(This));
+       if (fci->object && !(func->common.fn_flags & ZEND_ACC_STATIC)) {
+               OBJ_RELEASE(fci->object);
        }
 
-       Z_OBJ(EG(This)) = orig_object;
        EG(scope) = orig_scope;
        if (EG(current_execute_data) == &dummy_execute_data) {
                EG(current_execute_data) = dummy_execute_data.prev_execute_data;
index 4c64cb7590776927d750301fbd1b7ff6e771ca9a..6ffd264a1d349d8488869eb843bdfd409d2da54e 100644 (file)
@@ -68,8 +68,8 @@ static void zend_generator_cleanup_unfinished_execution(zend_generator *generato
        /* If yield was used as a function argument there may be active
         * method calls those objects need to be freed */
        while (execute_data->call) {
-               if (execute_data->call->object) {
-                       OBJ_RELEASE(execute_data->call->object);
+               if (Z_OBJ(execute_data->call->This)) {
+                       OBJ_RELEASE(Z_OBJ(execute_data->call->This));
                }
                execute_data->call = execute_data->call->prev_execute_data;
        }
@@ -98,8 +98,8 @@ ZEND_API void zend_generator_close(zend_generator *generator, zend_bool finished
                        zend_clean_and_cache_symbol_table(execute_data->symbol_table TSRMLS_CC);
                }
 
-               if (execute_data->object) {
-                       OBJ_RELEASE(execute_data->object);
+               if (Z_OBJ(execute_data->This)) {
+                       OBJ_RELEASE(Z_OBJ(execute_data->This));
                }
 
                /* A fatal error / die occurred during the generator execution. Trying to clean
@@ -251,8 +251,8 @@ ZEND_API void zend_generator_create_zval(zend_execute_data *call, zend_op_array
 
        object_init_ex(return_value, zend_ce_generator);
 
-       if (Z_OBJ(EG(This))) {
-               Z_ADDREF(EG(This));
+       if (Z_OBJ(call->This)) {
+               Z_ADDREF(call->This);
        }
 
        /* Save execution context in generator object. */
@@ -292,15 +292,11 @@ ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{
        {
                /* Backup executor globals */
                zend_execute_data *original_execute_data = EG(current_execute_data);
-               zend_object *original_This;
                zend_class_entry *original_scope = EG(scope);
                zend_vm_stack original_stack = EG(argument_stack);
 
-               original_This = Z_OBJ(EG(This));
-
                /* Set executor globals */
                EG(current_execute_data) = generator->execute_data;
-               Z_OBJ(EG(This)) = generator->execute_data->object;
                EG(scope) = generator->execute_data->scope;
                EG(argument_stack) = generator->stack;
 
@@ -322,7 +318,6 @@ ZEND_API void zend_generator_resume(zend_generator *generator TSRMLS_DC) /* {{{
 
                /* Restore executor globals */
                EG(current_execute_data) = original_execute_data;
-               Z_OBJ(EG(This)) = original_This;
                EG(scope) = original_scope;
                EG(argument_stack) = original_stack;
 
index 69e1cf9e682715b97ea489f47e450c5456be64b7..d2be4ec5c21a328a819c3c55de8dbba9d073ab3e 100644 (file)
@@ -174,8 +174,6 @@ struct _zend_executor_globals {
 
        zend_class_entry *scope;
 
-       zval This;
-
        zend_long precision;
 
        int ticks_count;
index f831d2fadd623bb345d48f210fad98e532d8ea11..c2377e7512430c8d11be36c76c08968f741f1e9b 100644 (file)
@@ -921,7 +921,7 @@ static void zend_std_unset_dimension(zval *object, zval *offset TSRMLS_DC) /* {{
 
 ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
 {
-       zend_internal_function *func = (zend_internal_function *)EG(current_execute_data)->func;
+       zend_internal_function *func = (zend_internal_function *)EX(func);
        zval method_name, method_args;
        zval method_result;
        zend_class_entry *ce = Z_OBJCE_P(getThis());
@@ -1139,7 +1139,7 @@ static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_str
 
 ZEND_API void zend_std_callstatic_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */
 {
-       zend_internal_function *func = (zend_internal_function *)EG(current_execute_data)->func;
+       zend_internal_function *func = (zend_internal_function *)EX(func);
        zval method_name, method_args;
        zval method_result;
        zend_class_entry *ce = EG(scope);
@@ -1231,9 +1231,9 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st
                                zend_string_free(lc_function_name);
                        }
                        if (ce->__call &&
-                           Z_OBJ(EG(This)) &&
-                           Z_OBJ_HT(EG(This))->get_class_entry &&
-                           instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {
+                           Z_OBJ(EG(current_execute_data)->This) &&
+                           Z_OBJ_HT(EG(current_execute_data)->This)->get_class_entry &&
+                           instanceof_function(Z_OBJCE(EG(current_execute_data)->This), ce TSRMLS_CC)) {
                                return zend_get_user_call_function(ce, function_name);
                        } else if (ce->__callstatic) {
                                return zend_get_user_callstatic_function(ce, function_name);
index c6541061921223171521ad61390ed83e16ee1943..1ac7b298ebed23e9fc58743ede596e7b753dacb6 100644 (file)
@@ -90,6 +90,7 @@ typedef uint32_t zend_uintptr_t;
 typedef struct _zend_object_handlers zend_object_handlers;
 typedef struct _zend_class_entry     zend_class_entry;
 typedef union  _zend_function        zend_function;
+typedef struct _zend_execute_data    zend_execute_data;
 
 typedef struct _zval_struct     zval;
 
index 966cf915763812488933ac9a3f2f5dc88f4db5f5..b843f42c418bce213e6ed46602d5e4572a2b2bd4 100644 (file)
@@ -1711,6 +1711,8 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
        vm_frame_kind frame_kind = EX(frame_kind);
 
        if (frame_kind == VM_FRAME_NESTED_FUNCTION) {
+               zend_object *object;
+
                i_free_compiled_variables(execute_data TSRMLS_CC);
                if (UNEXPECTED(EX(symbol_table) != NULL)) {
                        zend_clean_and_cache_symbol_table(EX(symbol_table) TSRMLS_CC);
@@ -1720,26 +1722,22 @@ ZEND_VM_HELPER(zend_leave_helper, ANY, ANY)
                if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_CLOSURE) != 0) && EX(func)->op_array.prototype) {
                        OBJ_RELEASE((zend_object*)EX(func)->op_array.prototype);
                }
+               object = Z_OBJ(EX(This));
                zend_vm_stack_free_call_frame(execute_data TSRMLS_CC);
 
                execute_data = EG(current_execute_data);
 
-               if (Z_OBJ(EG(This))) {
+               if (object) {
                        if (UNEXPECTED(EG(exception) != NULL) && (EX(opline)->op1.num & ZEND_CALL_CTOR)) {
                                if (!(EX(opline)->op1.num & ZEND_CALL_CTOR_RESULT_UNUSED)) {
-                                       Z_DELREF(EG(This));
+                                       GC_REFCOUNT(object)--;
                                }
-                               if (Z_REFCOUNT(EG(This)) == 1) {
-                                       zend_object_store_ctor_failed(Z_OBJ(EG(This)) TSRMLS_CC);
+                               if (GC_REFCOUNT(object) == 1) {
+                                       zend_object_store_ctor_failed(object TSRMLS_CC);
                                }
                        }
-                       if (!Z_DELREF(EG(This))) {
-                               _zval_dtor_func_for_ptr(Z_COUNTED(EG(This)) ZEND_FILE_LINE_CC);
-                       } else if (UNEXPECTED(!Z_GC_INFO(EG(This)))) {
-                               gc_possible_root(Z_COUNTED(EG(This)) TSRMLS_CC);
-                       }
+                       OBJ_RELEASE(object);
                }
-               Z_OBJ(EG(This)) = EX(object);
                EG(scope) = EX(scope);
 
                if (UNEXPECTED(EG(exception) != NULL)) {
@@ -2252,7 +2250,7 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
                if (UNEXPECTED(ce->constructor == NULL)) {
                        zend_error_noreturn(E_ERROR, "Cannot call constructor");
                }
-               if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+               if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
                        zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val);
                }
                fbc = ce->constructor;
@@ -2260,8 +2258,8 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMP|VAR|UNUS
 
        object = NULL;
        if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
-               if (EX(object)) {
-                       object = EX(object);
+               if (Z_OBJ(EX(This))) {
+                       object = Z_OBJ(EX(This));
                        GC_REFCOUNT(object)++;
                        if (object->handlers->get_class_entry &&
                            !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
@@ -2532,6 +2530,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
        USE_OPLINE
        zend_execute_data *call = EX(call);
        zend_function *fbc = call->func;
+       zend_object *object = Z_OBJ(call->This);
 
        SAVE_OPLINE();
        EX(call) = call->prev_execute_data;
@@ -2551,7 +2550,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
        }
        if (fbc->common.scope &&
                !(fbc->common.fn_flags & ZEND_ACC_STATIC) &&
-               !call->object) {
+               !object) {
 
                if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
                        /* FIXME: output identifiers properly */
@@ -2574,16 +2573,16 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
 
                if (fbc->common.scope) {
                        should_change_scope = 1;
-                       Z_OBJ(EG(This)) = call->object;
                        /* TODO: we don't set scope if we call an object method ??? */
                        /* See: ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt */
 #if 1
-                       EG(scope) = (call->object) ? NULL : fbc->common.scope;
+                       EG(scope) = object ? NULL : fbc->common.scope;
 #else 
                        EG(scope) = fbc->common.scope;
 #endif
-               } else {
+               } else {                        
                        call->called_scope = EX(called_scope);
+                       Z_OBJ(call->This) = Z_OBJ(EX(This));
                }
 
                call->prev_execute_data = execute_data;
@@ -2618,7 +2617,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
 
                if (!zend_execute_internal) {
                        /* saves one function call if zend_execute_internal is not used */
-                       fbc->internal_function.handler(call->num_args, ret TSRMLS_CC);
+                       fbc->internal_function.handler(call, ret TSRMLS_CC);
                } else {
                        zend_execute_internal(call, ret TSRMLS_CC);
                }
@@ -2638,7 +2637,6 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
        } else if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) {
                zval *return_value = NULL;
 
-               Z_OBJ(EG(This)) = call->object;
                EG(scope) = fbc->common.scope;
                call->symbol_table = NULL;
                if (RETURN_VALUE_USED(opline)) {
@@ -2668,16 +2666,15 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
                        }
                }
        } else { /* ZEND_OVERLOADED_FUNCTION */
-               Z_OBJ(EG(This)) = call->object;
                EG(scope) = fbc->common.scope;
 
                ZVAL_NULL(EX_VAR(opline->result.var));
 
                /* Not sure what should be done here if it's a static method */
-               if (EXPECTED(call->object != NULL)) {
+               if (EXPECTED(object != NULL)) {
                        call->prev_execute_data = execute_data;
                        EG(current_execute_data) = call;
-                       call->object->handlers->call_method(fbc->common.function_name, call->object, call->num_args, EX_VAR(opline->result.var) TSRMLS_CC);
+                       object->handlers->call_method(fbc->common.function_name, object, call, EX_VAR(opline->result.var) TSRMLS_CC);
                        EG(current_execute_data) = call->prev_execute_data;
                } else {
                        zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object");
@@ -2702,18 +2699,17 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
        }
 
 ZEND_VM_C_LABEL(fcall_end_change_scope):
-       if (Z_OBJ(EG(This))) {
+       if (object) {
                if (UNEXPECTED(EG(exception) != NULL) && (opline->op1.num & ZEND_CALL_CTOR)) {
                        if (!(opline->op1.num & ZEND_CALL_CTOR_RESULT_UNUSED)) {
-                               Z_DELREF(EG(This));
+                               GC_REFCOUNT(object)--;
                        }
-                       if (Z_REFCOUNT(EG(This)) == 1) {
-                               zend_object_store_ctor_failed(Z_OBJ(EG(This)) TSRMLS_CC);
+                       if (GC_REFCOUNT(object) == 1) {
+                               zend_object_store_ctor_failed(object TSRMLS_CC);
                        }
                }
-               OBJ_RELEASE(Z_OBJ(EG(This)));
+               OBJ_RELEASE(object);
        }
-       Z_OBJ(EG(This)) = EX(object);
        EG(scope) = EX(scope);
 
 ZEND_VM_C_LABEL(fcall_end):
@@ -3257,12 +3253,12 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY)
                if (EX(call)->func->common.fn_flags & ZEND_ACC_CLOSURE) {
                        OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype);
                }
-               if (EX(call)->object) {
-                       OBJ_RELEASE(EX(call)->object);
+               if (Z_OBJ(EX(call)->This)) {
+                       OBJ_RELEASE(Z_OBJ(EX(call)->This));
                }
                EX(call)->func = (zend_function*)&zend_pass_function;
                EX(call)->called_scope = NULL;
-               EX(call)->object = NULL;
+               Z_OBJ(EX(call)->This) = NULL;
        } else {
                uint32_t arg_num = 1;
 
@@ -3320,12 +3316,12 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY)
                                                if (EX(call)->func->common.fn_flags & ZEND_ACC_CLOSURE) {
                                                        OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype);
                                                }
-                                               if (EX(call)->object) {
-                                                       OBJ_RELEASE(EX(call)->object);
+                                               if (Z_OBJ(EX(call)->This)) {
+                                                       OBJ_RELEASE(Z_OBJ(EX(call)->This));
                                                }
                                                EX(call)->func = (zend_function*)&zend_pass_function;
                                                EX(call)->called_scope = NULL;
-                                               EX(call)->object = NULL;
+                                               Z_OBJ(EX(call)->This) = NULL;
 
                                                break;
                                        }
@@ -3399,12 +3395,12 @@ ZEND_VM_HANDLER(120, ZEND_SEND_USER, VAR|CV, ANY)
                                if (EX(call)->func->common.fn_flags & ZEND_ACC_CLOSURE) {
                                        OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype);
                                }
-                               if (EX(call)->object) {
-                                       OBJ_RELEASE(EX(call)->object);
+                               if (Z_OBJ(EX(call)->This)) {
+                                       OBJ_RELEASE(Z_OBJ(EX(call)->This));
                                }
                                EX(call)->func = (zend_function*)&zend_pass_function;
                                EX(call)->called_scope = NULL;
-                               EX(call)->object = NULL;
+                               Z_OBJ(EX(call)->This) = NULL;
 
                                FREE_OP1();
                                CHECK_EXCEPTION();
@@ -4122,7 +4118,7 @@ ZEND_VM_HANDLER(73, ZEND_INCLUDE_OR_EVAL, CONST|TMP|VAR|CV, ANY)
                }
 
                call = zend_vm_stack_push_call_frame(
-                       (zend_function*)new_op_array, 0, 0, EX(called_scope), EX(object), NULL TSRMLS_CC);
+                       (zend_function*)new_op_array, 0, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC);
 
                if (EX(symbol_table)) {
                        call->symbol_table = EX(symbol_table);
@@ -5396,16 +5392,16 @@ ZEND_VM_HANDLER(149, ZEND_HANDLE_EXCEPTION, ANY, ANY)
                         * arguments pushed to the stack that have to be dtor'ed. */
                        zend_vm_stack_free_args(EX(call) TSRMLS_CC);
 
-                       if (call->object) {
+                       if (Z_OBJ(call->This)) {
                                if (call->flags & ZEND_CALL_CTOR) {
                                        if (!(call->flags & ZEND_CALL_CTOR_RESULT_UNUSED)) {
-                                               GC_REFCOUNT(call->object)--;
+                                               GC_REFCOUNT(Z_OBJ(call->This))--;
                                        }
-                                       if (GC_REFCOUNT(call->object) == 1) {
-                                               zend_object_store_ctor_failed(call->object TSRMLS_CC);
+                                       if (GC_REFCOUNT(Z_OBJ(call->This)) == 1) {
+                                               zend_object_store_ctor_failed(Z_OBJ(call->This) TSRMLS_CC);
                                        }
                                }
-                               OBJ_RELEASE(call->object);
+                               OBJ_RELEASE(Z_OBJ(call->This));
                        }
                        EX(call) = call->prev_execute_data;
                        zend_vm_stack_free_call_frame(call TSRMLS_CC);
@@ -5562,7 +5558,7 @@ ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, UNUSED)
        if (closure_is_static || closure_is_being_defined_inside_static_context) {
                zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(called_scope), NULL TSRMLS_CC);
        } else {
-               zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(scope), Z_OBJ(EG(This)) ? &EG(This) : NULL TSRMLS_CC);
+               zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(scope), Z_OBJ(EX(This)) ? &EX(This) : NULL TSRMLS_CC);
        }
 
        CHECK_EXCEPTION();
index eeb6d5cd3f0a0fd5c5711c5c0abab6b53b1c3111..82676436b171dd3522810c5ed0d6cd9c4f4fbeb8 100644 (file)
@@ -370,7 +370,7 @@ ZEND_API void zend_execute(zend_op_array *op_array, zval *return_value TSRMLS_DC
        }
 
        execute_data = zend_vm_stack_push_call_frame(
-               (zend_function*)op_array, 0, 0, EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL, Z_OBJ(EG(This)), NULL TSRMLS_CC);
+               (zend_function*)op_array, 0, 0, EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL, EG(current_execute_data) ? Z_OBJ(EG(current_execute_data)->This) : NULL, NULL TSRMLS_CC);
        if (EG(current_execute_data)) {
                execute_data->symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
        } else {
@@ -386,6 +386,8 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
        vm_frame_kind frame_kind = EX(frame_kind);
 
        if (frame_kind == VM_FRAME_NESTED_FUNCTION) {
+               zend_object *object;
+
                i_free_compiled_variables(execute_data TSRMLS_CC);
                if (UNEXPECTED(EX(symbol_table) != NULL)) {
                        zend_clean_and_cache_symbol_table(EX(symbol_table) TSRMLS_CC);
@@ -395,26 +397,22 @@ static int ZEND_FASTCALL zend_leave_helper_SPEC(ZEND_OPCODE_HANDLER_ARGS)
                if (UNEXPECTED((EX(func)->op_array.fn_flags & ZEND_ACC_CLOSURE) != 0) && EX(func)->op_array.prototype) {
                        OBJ_RELEASE((zend_object*)EX(func)->op_array.prototype);
                }
+               object = Z_OBJ(EX(This));
                zend_vm_stack_free_call_frame(execute_data TSRMLS_CC);
 
                execute_data = EG(current_execute_data);
 
-               if (Z_OBJ(EG(This))) {
+               if (object) {
                        if (UNEXPECTED(EG(exception) != NULL) && (EX(opline)->op1.num & ZEND_CALL_CTOR)) {
                                if (!(EX(opline)->op1.num & ZEND_CALL_CTOR_RESULT_UNUSED)) {
-                                       Z_DELREF(EG(This));
+                                       GC_REFCOUNT(object)--;
                                }
-                               if (Z_REFCOUNT(EG(This)) == 1) {
-                                       zend_object_store_ctor_failed(Z_OBJ(EG(This)) TSRMLS_CC);
+                               if (GC_REFCOUNT(object) == 1) {
+                                       zend_object_store_ctor_failed(object TSRMLS_CC);
                                }
                        }
-                       if (!Z_DELREF(EG(This))) {
-                               _zval_dtor_func_for_ptr(Z_COUNTED(EG(This)) ZEND_FILE_LINE_CC);
-                       } else if (UNEXPECTED(!Z_GC_INFO(EG(This)))) {
-                               gc_possible_root(Z_COUNTED(EG(This)) TSRMLS_CC);
-                       }
+                       OBJ_RELEASE(object);
                }
-               Z_OBJ(EG(This)) = EX(object);
                EG(scope) = EX(scope);
 
                if (UNEXPECTED(EG(exception) != NULL)) {
@@ -493,6 +491,7 @@ static int ZEND_FASTCALL  ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
        USE_OPLINE
        zend_execute_data *call = EX(call);
        zend_function *fbc = call->func;
+       zend_object *object = Z_OBJ(call->This);
 
        SAVE_OPLINE();
        EX(call) = call->prev_execute_data;
@@ -512,7 +511,7 @@ static int ZEND_FASTCALL  ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
        }
        if (fbc->common.scope &&
                !(fbc->common.fn_flags & ZEND_ACC_STATIC) &&
-               !call->object) {
+               !object) {
 
                if (fbc->common.fn_flags & ZEND_ACC_ALLOW_STATIC) {
                        /* FIXME: output identifiers properly */
@@ -535,16 +534,16 @@ static int ZEND_FASTCALL  ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 
                if (fbc->common.scope) {
                        should_change_scope = 1;
-                       Z_OBJ(EG(This)) = call->object;
                        /* TODO: we don't set scope if we call an object method ??? */
                        /* See: ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt */
 #if 1
-                       EG(scope) = (call->object) ? NULL : fbc->common.scope;
+                       EG(scope) = object ? NULL : fbc->common.scope;
 #else
                        EG(scope) = fbc->common.scope;
 #endif
                } else {
                        call->called_scope = EX(called_scope);
+                       Z_OBJ(call->This) = Z_OBJ(EX(This));
                }
 
                call->prev_execute_data = execute_data;
@@ -579,7 +578,7 @@ static int ZEND_FASTCALL  ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
 
                if (!zend_execute_internal) {
                        /* saves one function call if zend_execute_internal is not used */
-                       fbc->internal_function.handler(call->num_args, ret TSRMLS_CC);
+                       fbc->internal_function.handler(call, ret TSRMLS_CC);
                } else {
                        zend_execute_internal(call, ret TSRMLS_CC);
                }
@@ -599,7 +598,6 @@ static int ZEND_FASTCALL  ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
        } else if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) {
                zval *return_value = NULL;
 
-               Z_OBJ(EG(This)) = call->object;
                EG(scope) = fbc->common.scope;
                call->symbol_table = NULL;
                if (RETURN_VALUE_USED(opline)) {
@@ -629,16 +627,15 @@ static int ZEND_FASTCALL  ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
                        }
                }
        } else { /* ZEND_OVERLOADED_FUNCTION */
-               Z_OBJ(EG(This)) = call->object;
                EG(scope) = fbc->common.scope;
 
                ZVAL_NULL(EX_VAR(opline->result.var));
 
                /* Not sure what should be done here if it's a static method */
-               if (EXPECTED(call->object != NULL)) {
+               if (EXPECTED(object != NULL)) {
                        call->prev_execute_data = execute_data;
                        EG(current_execute_data) = call;
-                       call->object->handlers->call_method(fbc->common.function_name, call->object, call->num_args, EX_VAR(opline->result.var) TSRMLS_CC);
+                       object->handlers->call_method(fbc->common.function_name, object, call, EX_VAR(opline->result.var) TSRMLS_CC);
                        EG(current_execute_data) = call->prev_execute_data;
                } else {
                        zend_error_noreturn(E_ERROR, "Cannot call overloaded function for non-object");
@@ -663,18 +660,17 @@ static int ZEND_FASTCALL  ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
        }
 
 fcall_end_change_scope:
-       if (Z_OBJ(EG(This))) {
+       if (object) {
                if (UNEXPECTED(EG(exception) != NULL) && (opline->op1.num & ZEND_CALL_CTOR)) {
                        if (!(opline->op1.num & ZEND_CALL_CTOR_RESULT_UNUSED)) {
-                               Z_DELREF(EG(This));
+                               GC_REFCOUNT(object)--;
                        }
-                       if (Z_REFCOUNT(EG(This)) == 1) {
-                               zend_object_store_ctor_failed(Z_OBJ(EG(This)) TSRMLS_CC);
+                       if (GC_REFCOUNT(object) == 1) {
+                               zend_object_store_ctor_failed(object TSRMLS_CC);
                        }
                }
-               OBJ_RELEASE(Z_OBJ(EG(This)));
+               OBJ_RELEASE(object);
        }
-       Z_OBJ(EG(This)) = EX(object);
        EG(scope) = EX(scope);
 
 fcall_end:
@@ -881,12 +877,12 @@ static int ZEND_FASTCALL  ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
                if (EX(call)->func->common.fn_flags & ZEND_ACC_CLOSURE) {
                        OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype);
                }
-               if (EX(call)->object) {
-                       OBJ_RELEASE(EX(call)->object);
+               if (Z_OBJ(EX(call)->This)) {
+                       OBJ_RELEASE(Z_OBJ(EX(call)->This));
                }
                EX(call)->func = (zend_function*)&zend_pass_function;
                EX(call)->called_scope = NULL;
-               EX(call)->object = NULL;
+               Z_OBJ(EX(call)->This) = NULL;
        } else {
                uint32_t arg_num = 1;
 
@@ -944,12 +940,12 @@ static int ZEND_FASTCALL  ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
                                                if (EX(call)->func->common.fn_flags & ZEND_ACC_CLOSURE) {
                                                        OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype);
                                                }
-                                               if (EX(call)->object) {
-                                                       OBJ_RELEASE(EX(call)->object);
+                                               if (Z_OBJ(EX(call)->This)) {
+                                                       OBJ_RELEASE(Z_OBJ(EX(call)->This));
                                                }
                                                EX(call)->func = (zend_function*)&zend_pass_function;
                                                EX(call)->called_scope = NULL;
-                                               EX(call)->object = NULL;
+                                               Z_OBJ(EX(call)->This) = NULL;
 
                                                break;
                                        }
@@ -1298,16 +1294,16 @@ static int ZEND_FASTCALL  ZEND_HANDLE_EXCEPTION_SPEC_HANDLER(ZEND_OPCODE_HANDLER
                         * arguments pushed to the stack that have to be dtor'ed. */
                        zend_vm_stack_free_args(EX(call) TSRMLS_CC);
 
-                       if (call->object) {
+                       if (Z_OBJ(call->This)) {
                                if (call->flags & ZEND_CALL_CTOR) {
                                        if (!(call->flags & ZEND_CALL_CTOR_RESULT_UNUSED)) {
-                                               GC_REFCOUNT(call->object)--;
+                                               GC_REFCOUNT(Z_OBJ(call->This))--;
                                        }
-                                       if (GC_REFCOUNT(call->object) == 1) {
-                                               zend_object_store_ctor_failed(call->object TSRMLS_CC);
+                                       if (GC_REFCOUNT(Z_OBJ(call->This)) == 1) {
+                                               zend_object_store_ctor_failed(Z_OBJ(call->This) TSRMLS_CC);
                                        }
                                }
-                               OBJ_RELEASE(call->object);
+                               OBJ_RELEASE(Z_OBJ(call->This));
                        }
                        EX(call) = call->prev_execute_data;
                        zend_vm_stack_free_call_frame(call TSRMLS_CC);
@@ -2993,7 +2989,7 @@ static int ZEND_FASTCALL  ZEND_INCLUDE_OR_EVAL_SPEC_CONST_HANDLER(ZEND_OPCODE_HA
                }
 
                call = zend_vm_stack_push_call_frame(
-                       (zend_function*)new_op_array, 0, 0, EX(called_scope), EX(object), NULL TSRMLS_CC);
+                       (zend_function*)new_op_array, 0, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC);
 
                if (EX(symbol_table)) {
                        call->symbol_table = EX(symbol_table);
@@ -4123,7 +4119,7 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
                if (UNEXPECTED(ce->constructor == NULL)) {
                        zend_error_noreturn(E_ERROR, "Cannot call constructor");
                }
-               if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+               if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
                        zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val);
                }
                fbc = ce->constructor;
@@ -4131,8 +4127,8 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CONST_HANDLER(
 
        object = NULL;
        if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
-               if (EX(object)) {
-                       object = EX(object);
+               if (Z_OBJ(EX(This))) {
+                       object = Z_OBJ(EX(This));
                        GC_REFCOUNT(object)++;
                        if (object->handlers->get_class_entry &&
                            !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
@@ -5429,7 +5425,7 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE
                if (UNEXPECTED(ce->constructor == NULL)) {
                        zend_error_noreturn(E_ERROR, "Cannot call constructor");
                }
-               if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+               if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
                        zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val);
                }
                fbc = ce->constructor;
@@ -5437,8 +5433,8 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_TMP_HANDLER(ZE
 
        object = NULL;
        if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
-               if (EX(object)) {
-                       object = EX(object);
+               if (Z_OBJ(EX(This))) {
+                       object = Z_OBJ(EX(This));
                        GC_REFCOUNT(object)++;
                        if (object->handlers->get_class_entry &&
                            !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
@@ -6605,7 +6601,7 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE
                if (UNEXPECTED(ce->constructor == NULL)) {
                        zend_error_noreturn(E_ERROR, "Cannot call constructor");
                }
-               if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+               if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
                        zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val);
                }
                fbc = ce->constructor;
@@ -6613,8 +6609,8 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_VAR_HANDLER(ZE
 
        object = NULL;
        if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
-               if (EX(object)) {
-                       object = EX(object);
+               if (Z_OBJ(EX(This))) {
+                       object = Z_OBJ(EX(This));
                        GC_REFCOUNT(object)++;
                        if (object->handlers->get_class_entry &&
                            !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
@@ -7532,7 +7528,7 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
                if (UNEXPECTED(ce->constructor == NULL)) {
                        zend_error_noreturn(E_ERROR, "Cannot call constructor");
                }
-               if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+               if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
                        zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val);
                }
                fbc = ce->constructor;
@@ -7540,8 +7536,8 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_UNUSED_HANDLER
 
        object = NULL;
        if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
-               if (EX(object)) {
-                       object = EX(object);
+               if (Z_OBJ(EX(This))) {
+                       object = Z_OBJ(EX(This));
                        GC_REFCOUNT(object)++;
                        if (object->handlers->get_class_entry &&
                            !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
@@ -7868,7 +7864,7 @@ static int ZEND_FASTCALL  ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER
        if (closure_is_static || closure_is_being_defined_inside_static_context) {
                zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(called_scope), NULL TSRMLS_CC);
        } else {
-               zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(scope), Z_OBJ(EG(This)) ? &EG(This) : NULL TSRMLS_CC);
+               zend_create_closure(EX_VAR(opline->result.var), Z_FUNC_P(zfunc), EX(scope), Z_OBJ(EX(This)) ? &EX(This) : NULL TSRMLS_CC);
        }
 
        CHECK_EXCEPTION();
@@ -8516,7 +8512,7 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
                if (UNEXPECTED(ce->constructor == NULL)) {
                        zend_error_noreturn(E_ERROR, "Cannot call constructor");
                }
-               if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+               if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
                        zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val);
                }
                fbc = ce->constructor;
@@ -8524,8 +8520,8 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_CONST_CV_HANDLER(ZEN
 
        object = NULL;
        if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
-               if (EX(object)) {
-                       object = EX(object);
+               if (Z_OBJ(EX(This))) {
+                       object = Z_OBJ(EX(This));
                        GC_REFCOUNT(object)++;
                        if (object->handlers->get_class_entry &&
                            !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
@@ -9732,7 +9728,7 @@ static int ZEND_FASTCALL  ZEND_INCLUDE_OR_EVAL_SPEC_TMP_HANDLER(ZEND_OPCODE_HAND
                }
 
                call = zend_vm_stack_push_call_frame(
-                       (zend_function*)new_op_array, 0, 0, EX(called_scope), EX(object), NULL TSRMLS_CC);
+                       (zend_function*)new_op_array, 0, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC);
 
                if (EX(symbol_table)) {
                        call->symbol_table = EX(symbol_table);
@@ -16004,12 +16000,12 @@ static int ZEND_FASTCALL  ZEND_SEND_USER_SPEC_VAR_HANDLER(ZEND_OPCODE_HANDLER_AR
                                if (EX(call)->func->common.fn_flags & ZEND_ACC_CLOSURE) {
                                        OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype);
                                }
-                               if (EX(call)->object) {
-                                       OBJ_RELEASE(EX(call)->object);
+                               if (Z_OBJ(EX(call)->This)) {
+                                       OBJ_RELEASE(Z_OBJ(EX(call)->This));
                                }
                                EX(call)->func = (zend_function*)&zend_pass_function;
                                EX(call)->called_scope = NULL;
-                               EX(call)->object = NULL;
+                               Z_OBJ(EX(call)->This) = NULL;
 
                                zval_ptr_dtor_nogc(free_op1.var);
                                CHECK_EXCEPTION();
@@ -16321,7 +16317,7 @@ static int ZEND_FASTCALL  ZEND_INCLUDE_OR_EVAL_SPEC_VAR_HANDLER(ZEND_OPCODE_HAND
                }
 
                call = zend_vm_stack_push_call_frame(
-                       (zend_function*)new_op_array, 0, 0, EX(called_scope), EX(object), NULL TSRMLS_CC);
+                       (zend_function*)new_op_array, 0, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC);
 
                if (EX(symbol_table)) {
                        call->symbol_table = EX(symbol_table);
@@ -18532,7 +18528,7 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE
                if (UNEXPECTED(ce->constructor == NULL)) {
                        zend_error_noreturn(E_ERROR, "Cannot call constructor");
                }
-               if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+               if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
                        zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val);
                }
                fbc = ce->constructor;
@@ -18540,8 +18536,8 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CONST_HANDLER(ZE
 
        object = NULL;
        if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
-               if (EX(object)) {
-                       object = EX(object);
+               if (Z_OBJ(EX(This))) {
+                       object = Z_OBJ(EX(This));
                        GC_REFCOUNT(object)++;
                        if (object->handlers->get_class_entry &&
                            !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
@@ -20748,7 +20744,7 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND
                if (UNEXPECTED(ce->constructor == NULL)) {
                        zend_error_noreturn(E_ERROR, "Cannot call constructor");
                }
-               if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+               if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
                        zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val);
                }
                fbc = ce->constructor;
@@ -20756,8 +20752,8 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_TMP_HANDLER(ZEND
 
        object = NULL;
        if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
-               if (EX(object)) {
-                       object = EX(object);
+               if (Z_OBJ(EX(This))) {
+                       object = Z_OBJ(EX(This));
                        GC_REFCOUNT(object)++;
                        if (object->handlers->get_class_entry &&
                            !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
@@ -22930,7 +22926,7 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND
                if (UNEXPECTED(ce->constructor == NULL)) {
                        zend_error_noreturn(E_ERROR, "Cannot call constructor");
                }
-               if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+               if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
                        zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val);
                }
                fbc = ce->constructor;
@@ -22938,8 +22934,8 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_VAR_HANDLER(ZEND
 
        object = NULL;
        if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
-               if (EX(object)) {
-                       object = EX(object);
+               if (Z_OBJ(EX(This))) {
+                       object = Z_OBJ(EX(This));
                        GC_REFCOUNT(object)++;
                        if (object->handlers->get_class_entry &&
                            !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
@@ -24397,7 +24393,7 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z
                if (UNEXPECTED(ce->constructor == NULL)) {
                        zend_error_noreturn(E_ERROR, "Cannot call constructor");
                }
-               if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+               if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
                        zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val);
                }
                fbc = ce->constructor;
@@ -24405,8 +24401,8 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_UNUSED_HANDLER(Z
 
        object = NULL;
        if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
-               if (EX(object)) {
-                       object = EX(object);
+               if (Z_OBJ(EX(This))) {
+                       object = Z_OBJ(EX(This));
                        GC_REFCOUNT(object)++;
                        if (object->handlers->get_class_entry &&
                            !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
@@ -26298,7 +26294,7 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_
                if (UNEXPECTED(ce->constructor == NULL)) {
                        zend_error_noreturn(E_ERROR, "Cannot call constructor");
                }
-               if (EX(object) && zend_get_class_entry(EX(object) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
+               if (Z_OBJ(EX(This)) && zend_get_class_entry(Z_OBJ(EX(This)) TSRMLS_CC) != ce->constructor->common.scope && (ce->constructor->common.fn_flags & ZEND_ACC_PRIVATE)) {
                        zend_error_noreturn(E_ERROR, "Cannot call private %s::__construct()", ce->name->val);
                }
                fbc = ce->constructor;
@@ -26306,8 +26302,8 @@ static int ZEND_FASTCALL  ZEND_INIT_STATIC_METHOD_CALL_SPEC_VAR_CV_HANDLER(ZEND_
 
        object = NULL;
        if (!(fbc->common.fn_flags & ZEND_ACC_STATIC)) {
-               if (EX(object)) {
-                       object = EX(object);
+               if (Z_OBJ(EX(This))) {
+                       object = Z_OBJ(EX(This));
                        GC_REFCOUNT(object)++;
                        if (object->handlers->get_class_entry &&
                            !instanceof_function(zend_get_class_entry(object TSRMLS_CC), ce TSRMLS_CC)) {
@@ -26899,7 +26895,7 @@ static int ZEND_FASTCALL  ZEND_CLONE_SPEC_UNUSED_HANDLER(ZEND_OPCODE_HANDLER_ARG
        zend_object_clone_obj_t clone_call;
 
        SAVE_OPLINE();
-       obj = _get_obj_zval_ptr_unused(TSRMLS_C);
+       obj = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
 
        if (IS_UNUSED == IS_CONST ||
            UNEXPECTED(Z_TYPE_P(obj) != IS_OBJECT)) {
@@ -26973,7 +26969,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CONST(int
 {
        USE_OPLINE
        zend_free_op free_op_data1;
-       zval *object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       zval *object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        zval *property = opline->op2.zv;
        zval *value;
        int have_get_ptr = 0;
@@ -27070,7 +27066,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CONST(int
        zval *value, *container;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
        } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
@@ -27329,7 +27325,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CONST(incde
        int have_get_ptr = 0;
 
        SAVE_OPLINE();
-       object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        property = opline->op2.zv;
        retval = EX_VAR(opline->result.var);
 
@@ -27420,7 +27416,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CONST(incd
        int have_get_ptr = 0;
 
        SAVE_OPLINE();
-       object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        property = opline->op2.zv;
        retval = EX_VAR(opline->result.var);
 
@@ -27506,7 +27502,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_R_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        offset  = opline->op2.zv;
 
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
@@ -27539,7 +27535,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_W_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE
        SAVE_OPLINE();
        property = opline->op2.zv;
 
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
        }
@@ -27563,7 +27559,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCOD
 
        SAVE_OPLINE();
        property = opline->op2.zv;
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
 
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
@@ -27587,7 +27583,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCOD
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        offset  = opline->op2.zv;
 
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
@@ -27621,7 +27617,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CONST_HANDLER(ZEND
 
                SAVE_OPLINE();
                property = opline->op2.zv;
-               container = _get_obj_zval_ptr_unused(TSRMLS_C);
+               container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
 
         if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) {
             zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
@@ -27649,7 +27645,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CONST_HANDLER(ZEND_OP
        zval *container, *property;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        property = opline->op2.zv;
 
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
@@ -27673,7 +27669,7 @@ static int ZEND_FASTCALL  ZEND_ASSIGN_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_
        zval *property_name;
 
        SAVE_OPLINE();
-       object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        property_name = opline->op2.zv;
 
        if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -27748,7 +27744,7 @@ static int ZEND_FASTCALL  ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CONST_HANDLER(ZEND_O
                zend_error_noreturn(E_ERROR, "Method name must be a string");
        }
 
-       object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
 
        if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
                if (UNEXPECTED(EG(exception) != NULL)) {
@@ -27932,7 +27928,7 @@ static int ZEND_FASTCALL  ZEND_UNSET_DIM_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
        zend_ulong hval;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
        }
@@ -28021,7 +28017,7 @@ static int ZEND_FASTCALL  ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HANDLER(ZEND_OPCODE_H
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
        }
@@ -28051,7 +28047,7 @@ static int ZEND_FASTCALL  ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CONST_HANDLER(Z
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        offset = opline->op2.zv;
 
        if (Z_TYPE_P(container) == IS_ARRAY) {
@@ -28163,7 +28159,7 @@ static int ZEND_FASTCALL  ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CONST_HANDLER(
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        offset = opline->op2.zv;
 
        if (Z_TYPE_P(container) == IS_OBJECT) {
@@ -28325,7 +28321,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_TMP(int (*
 {
        USE_OPLINE
        zend_free_op free_op2, free_op_data1;
-       zval *object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       zval *object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        zval *property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
        zval *value;
        int have_get_ptr = 0;
@@ -28423,7 +28419,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_TMP(int (*
        zval *value, *container;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
        } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
@@ -28682,7 +28678,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_TMP(incdec_
        int have_get_ptr = 0;
 
        SAVE_OPLINE();
-       object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
        retval = EX_VAR(opline->result.var);
 
@@ -28774,7 +28770,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_TMP(incdec
        int have_get_ptr = 0;
 
        SAVE_OPLINE();
-       object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
        retval = EX_VAR(opline->result.var);
 
@@ -28861,7 +28857,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_H
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        offset  = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
@@ -28895,7 +28891,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_W_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_H
        SAVE_OPLINE();
        property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
        }
@@ -28919,7 +28915,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_RW_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_
 
        SAVE_OPLINE();
        property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
 
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
@@ -28943,7 +28939,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        offset  = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
@@ -28978,7 +28974,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_TMP_HANDLER(ZEND_O
 
                SAVE_OPLINE();
                property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
-               container = _get_obj_zval_ptr_unused(TSRMLS_C);
+               container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
 
         if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) {
             zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
@@ -29006,7 +29002,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCO
        zval *container, *property;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        property = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
@@ -29030,7 +29026,7 @@ static int ZEND_FASTCALL  ZEND_ASSIGN_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HA
        zval *property_name;
 
        SAVE_OPLINE();
-       object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        property_name = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
        if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -29111,7 +29107,7 @@ static int ZEND_FASTCALL  ZEND_INIT_METHOD_CALL_SPEC_UNUSED_TMP_HANDLER(ZEND_OPC
                zend_error_noreturn(E_ERROR, "Method name must be a string");
        }
 
-       object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
 
        if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
                if (UNEXPECTED(EG(exception) != NULL)) {
@@ -29200,7 +29196,7 @@ static int ZEND_FASTCALL  ZEND_UNSET_DIM_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
        zend_ulong hval;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
        }
@@ -29289,7 +29285,7 @@ static int ZEND_FASTCALL  ZEND_UNSET_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEND_OPCODE_HAN
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
        }
@@ -29319,7 +29315,7 @@ static int ZEND_FASTCALL  ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_TMP_HANDLER(ZEN
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
        if (Z_TYPE_P(container) == IS_ARRAY) {
@@ -29432,7 +29428,7 @@ static int ZEND_FASTCALL  ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_TMP_HANDLER(ZE
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        offset = _get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
        if (Z_TYPE_P(container) == IS_OBJECT) {
@@ -29595,7 +29591,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_VAR(int (*
 {
        USE_OPLINE
        zend_free_op free_op2, free_op_data1;
-       zval *object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       zval *object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        zval *property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
        zval *value;
        int have_get_ptr = 0;
@@ -29693,7 +29689,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_VAR(int (*
        zval *value, *container;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
        } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
@@ -29952,7 +29948,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_VAR(incdec_
        int have_get_ptr = 0;
 
        SAVE_OPLINE();
-       object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
        retval = EX_VAR(opline->result.var);
 
@@ -30044,7 +30040,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_VAR(incdec
        int have_get_ptr = 0;
 
        SAVE_OPLINE();
-       object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
        retval = EX_VAR(opline->result.var);
 
@@ -30131,7 +30127,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_R_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_H
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        offset  = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
@@ -30165,7 +30161,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_W_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_H
        SAVE_OPLINE();
        property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
        }
@@ -30189,7 +30185,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_RW_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_
 
        SAVE_OPLINE();
        property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
 
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
@@ -30213,7 +30209,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_IS_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        offset  = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
@@ -30248,7 +30244,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_VAR_HANDLER(ZEND_O
 
                SAVE_OPLINE();
                property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
-               container = _get_obj_zval_ptr_unused(TSRMLS_C);
+               container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
 
         if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) {
             zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
@@ -30276,7 +30272,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCO
        zval *container, *property;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        property = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
@@ -30300,7 +30296,7 @@ static int ZEND_FASTCALL  ZEND_ASSIGN_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HA
        zval *property_name;
 
        SAVE_OPLINE();
-       object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        property_name = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
        if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -30381,7 +30377,7 @@ static int ZEND_FASTCALL  ZEND_INIT_METHOD_CALL_SPEC_UNUSED_VAR_HANDLER(ZEND_OPC
                zend_error_noreturn(E_ERROR, "Method name must be a string");
        }
 
-       object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
 
        if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
                if (UNEXPECTED(EG(exception) != NULL)) {
@@ -30470,7 +30466,7 @@ static int ZEND_FASTCALL  ZEND_UNSET_DIM_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
        zend_ulong hval;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
        }
@@ -30559,7 +30555,7 @@ static int ZEND_FASTCALL  ZEND_UNSET_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEND_OPCODE_HAN
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
        }
@@ -30589,7 +30585,7 @@ static int ZEND_FASTCALL  ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_VAR_HANDLER(ZEN
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
        if (Z_TYPE_P(container) == IS_ARRAY) {
@@ -30702,7 +30698,7 @@ static int ZEND_FASTCALL  ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_VAR_HANDLER(ZE
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        offset = _get_zval_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC);
 
        if (Z_TYPE_P(container) == IS_OBJECT) {
@@ -30865,7 +30861,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_UNUSED(int
 {
        USE_OPLINE
        zend_free_op free_op_data1;
-       zval *object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       zval *object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        zval *property = NULL;
        zval *value;
        int have_get_ptr = 0;
@@ -30962,7 +30958,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_UNUSED(int
        zval *value, *container;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
        } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
@@ -31381,7 +31377,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_obj_helper_SPEC_UNUSED_CV(int (*b
 {
        USE_OPLINE
        zend_free_op free_op_data1;
-       zval *object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       zval *object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        zval *property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
        zval *value;
        int have_get_ptr = 0;
@@ -31478,7 +31474,7 @@ static int ZEND_FASTCALL zend_binary_assign_op_dim_helper_SPEC_UNUSED_CV(int (*b
        zval *value, *container;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot use string offset as an array");
        } else if (UNEXPECTED(Z_TYPE_P(container) == IS_OBJECT)) {
@@ -31737,7 +31733,7 @@ static int ZEND_FASTCALL zend_pre_incdec_property_helper_SPEC_UNUSED_CV(incdec_t
        int have_get_ptr = 0;
 
        SAVE_OPLINE();
-       object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
        retval = EX_VAR(opline->result.var);
 
@@ -31828,7 +31824,7 @@ static int ZEND_FASTCALL zend_post_incdec_property_helper_SPEC_UNUSED_CV(incdec_
        int have_get_ptr = 0;
 
        SAVE_OPLINE();
-       object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
        retval = EX_VAR(opline->result.var);
 
@@ -31914,7 +31910,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HA
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        offset  = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
 
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
@@ -31947,7 +31943,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_W_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HA
        SAVE_OPLINE();
        property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
 
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
        }
@@ -31971,7 +31967,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_RW_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_H
 
        SAVE_OPLINE();
        property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
 
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot use string offset as an object");
@@ -31995,7 +31991,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_H
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        offset  = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
 
        if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT) ||
@@ -32029,7 +32025,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_FUNC_ARG_SPEC_UNUSED_CV_HANDLER(ZEND_OP
 
                SAVE_OPLINE();
                property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
-               container = _get_obj_zval_ptr_unused(TSRMLS_C);
+               container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
 
         if (IS_UNUSED == IS_CONST || IS_UNUSED == IS_TMP_VAR) {
             zend_error_noreturn(E_ERROR, "Cannot use temporary expression in write context");
@@ -32057,7 +32053,7 @@ static int ZEND_FASTCALL  ZEND_FETCH_OBJ_UNSET_SPEC_UNUSED_CV_HANDLER(ZEND_OPCOD
        zval *container, *property;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        property = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
 
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
@@ -32081,7 +32077,7 @@ static int ZEND_FASTCALL  ZEND_ASSIGN_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAN
        zval *property_name;
 
        SAVE_OPLINE();
-       object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        property_name = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
 
        if (IS_UNUSED == IS_VAR && UNEXPECTED(object == NULL)) {
@@ -32161,7 +32157,7 @@ static int ZEND_FASTCALL  ZEND_INIT_METHOD_CALL_SPEC_UNUSED_CV_HANDLER(ZEND_OPCO
                zend_error_noreturn(E_ERROR, "Method name must be a string");
        }
 
-       object = _get_obj_zval_ptr_unused(TSRMLS_C);
+       object = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
 
        if (UNEXPECTED(Z_TYPE_P(object) != IS_OBJECT)) {
                if (UNEXPECTED(EG(exception) != NULL)) {
@@ -32249,7 +32245,7 @@ static int ZEND_FASTCALL  ZEND_UNSET_DIM_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
        zend_ulong hval;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
        }
@@ -32338,7 +32334,7 @@ static int ZEND_FASTCALL  ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND_OPCODE_HAND
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        if (IS_UNUSED == IS_VAR && UNEXPECTED(container == NULL)) {
                zend_error_noreturn(E_ERROR, "Cannot unset string offsets");
        }
@@ -32368,7 +32364,7 @@ static int ZEND_FASTCALL  ZEND_ISSET_ISEMPTY_DIM_OBJ_SPEC_UNUSED_CV_HANDLER(ZEND
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
 
        if (Z_TYPE_P(container) == IS_ARRAY) {
@@ -32480,7 +32476,7 @@ static int ZEND_FASTCALL  ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UNUSED_CV_HANDLER(ZEN
        zval *offset;
 
        SAVE_OPLINE();
-       container = _get_obj_zval_ptr_unused(TSRMLS_C);
+       container = _get_obj_zval_ptr_unused(execute_data TSRMLS_CC);
        offset = _get_zval_ptr_cv_BP_VAR_R(execute_data, opline->op2.var TSRMLS_CC);
 
        if (Z_TYPE_P(container) == IS_OBJECT) {
@@ -33291,12 +33287,12 @@ static int ZEND_FASTCALL  ZEND_SEND_USER_SPEC_CV_HANDLER(ZEND_OPCODE_HANDLER_ARG
                                if (EX(call)->func->common.fn_flags & ZEND_ACC_CLOSURE) {
                                        OBJ_RELEASE((zend_object*)EX(call)->func->common.prototype);
                                }
-                               if (EX(call)->object) {
-                                       OBJ_RELEASE(EX(call)->object);
+                               if (Z_OBJ(EX(call)->This)) {
+                                       OBJ_RELEASE(Z_OBJ(EX(call)->This));
                                }
                                EX(call)->func = (zend_function*)&zend_pass_function;
                                EX(call)->called_scope = NULL;
-                               EX(call)->object = NULL;
+                               Z_OBJ(EX(call)->This) = NULL;
 
                                CHECK_EXCEPTION();
                                ZEND_VM_NEXT_OPCODE();
@@ -33603,7 +33599,7 @@ static int ZEND_FASTCALL  ZEND_INCLUDE_OR_EVAL_SPEC_CV_HANDLER(ZEND_OPCODE_HANDL
                }
 
                call = zend_vm_stack_push_call_frame(
-                       (zend_function*)new_op_array, 0, 0, EX(called_scope), EX(object), NULL TSRMLS_CC);
+                       (zend_function*)new_op_array, 0, 0, EX(called_scope), Z_OBJ(EX(This)), NULL TSRMLS_CC);
 
                if (EX(symbol_table)) {
                        call->symbol_table = EX(symbol_table);
index 58cbe097872cc6972dd8a7f397c4f34a68f1e948..4db87e5a858af83b7a4bef5c428145ad70ea1242 100644 (file)
@@ -35,7 +35,7 @@ ZEND_API void zend_{%EXECUTOR_NAME%}(zend_op_array *op_array, zval *return_value
        }
 
        execute_data = zend_vm_stack_push_call_frame(
-               (zend_function*)op_array, 0, 0, EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL, Z_OBJ(EG(This)), NULL TSRMLS_CC);
+               (zend_function*)op_array, 0, 0, EG(current_execute_data) ? EG(current_execute_data)->called_scope : NULL, EG(current_execute_data) ? Z_OBJ(EG(current_execute_data)->This) : NULL, NULL TSRMLS_CC);
        if (EG(current_execute_data)) {
                execute_data->symbol_table = zend_rebuild_symbol_table(TSRMLS_C);
        } else {
index b18b45b25c72854798f072900413dd957049b10e..69c25085aaa7bb47884f4673f8695d566e0cdcf2 100644 (file)
@@ -212,7 +212,7 @@ $op1_get_obj_zval_ptr_deref = array(
        "TMP"    => "_get_zval_ptr_tmp(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)",
        "VAR"    => "_get_zval_ptr_var_deref(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)",
        "CONST"  => "opline->op1.zv",
-       "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)",
+       "UNUSED" => "_get_obj_zval_ptr_unused(execute_data TSRMLS_CC)",
        "CV"     => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op1.var TSRMLS_CC)",
 );
 
@@ -221,7 +221,7 @@ $op2_get_obj_zval_ptr_deref = array(
        "TMP"    => "_get_zval_ptr_tmp(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)",
        "VAR"    => "_get_zval_ptr_var_deref(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)",
        "CONST"  => "opline->op2.zv",
-       "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)",
+       "UNUSED" => "_get_obj_zval_ptr_unused(execute_data TSRMLS_CC)",
        "CV"     => "_get_zval_ptr_cv_deref_\\1(execute_data, opline->op2.var TSRMLS_CC)",
 );
 
@@ -230,7 +230,7 @@ $op1_get_obj_zval_ptr_ptr = array(
        "TMP"    => "NULL",
        "VAR"    => "_get_zval_ptr_ptr_var(opline->op1.var, execute_data, &free_op1 TSRMLS_CC)",
        "CONST"  => "NULL",
-       "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)",
+       "UNUSED" => "_get_obj_zval_ptr_unused(execute_data TSRMLS_CC)",
        "CV"     => "_get_zval_ptr_cv_\\1(execute_data, opline->op1.var TSRMLS_CC)",
 );
 
@@ -239,7 +239,7 @@ $op2_get_obj_zval_ptr_ptr = array(
        "TMP"    => "NULL",
        "VAR"    => "_get_zval_ptr_ptr_var(opline->op2.var, execute_data, &free_op2 TSRMLS_CC)",
        "CONST"  => "NULL",
-       "UNUSED" => "_get_obj_zval_ptr_unused(TSRMLS_C)",
+       "UNUSED" => "_get_obj_zval_ptr_unused(execute_data TSRMLS_CC)",
        "CV"     => "_get_zval_ptr_cv_\\1(execute_data, opline->op2.var TSRMLS_CC)",
 );
 
index 2e34cfd03bbc8d285443631fe10aa37c9143a16a..6bcf8a218ccd4c53e32cbd094a68357c6fc013c3 100644 (file)
@@ -472,7 +472,7 @@ int php_com_do_invoke_byref(php_com_dotnet_object *obj, char *name, int namelen,
        HRESULT hr;
        VARIANT *vargs = NULL, *byref_vals = NULL;
        int i, byref_count = 0, j;
-       zend_internal_function *f = (zend_internal_function*)EG(current_execute_data)->func;
+       zend_internal_function *f = (zend_internal_function*)EX(func);
 
        /* assumption: that the active function (f) is the function we generated for the engine */
        if (!f || f->arg_info == NULL) {
index 2774593e1c1f6a0924f2e3c048f138b05ff21f2b..36480d4ebcfad4ede63825bf8224a5f02cbcbd4c 100644 (file)
@@ -250,7 +250,7 @@ static PHP_FUNCTION(com_method_handler)
        zval *object = getThis();
 
        Z_OBJ_HANDLER_P(object, call_method)(
-                       ((zend_internal_function*)EG(current_execute_data)->func)->function_name,
+                       ((zend_internal_function*)EX(func))->function_name,
                        Z_OBJ_P(object),
                        INTERNAL_FUNCTION_PARAM_PASSTHRU);
 }
index 2abd5a03ef51b43f19c9c06cc236bae087a0aab6..aca52ebf203ded7a1b7a7b66693c912b03807965 100644 (file)
@@ -425,7 +425,7 @@ static zval *pdo_stmt_instantiate(pdo_dbh_t *dbh, zval *object, zend_class_entry
        return object;
 } /* }}} */
 
-static void pdo_stmt_construct(pdo_stmt_t *stmt, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args TSRMLS_DC) /* {{{ */
+static void pdo_stmt_construct(zend_execute_data *execute_data, pdo_stmt_t *stmt, zval *object, zend_class_entry *dbstmt_ce, zval *ctor_args TSRMLS_DC) /* {{{ */
 {      
        zval query_string;
        zval z_key;
@@ -556,7 +556,7 @@ static PHP_METHOD(PDO, prepare)
        ZVAL_UNDEF(&stmt->lazy_object_ref);
 
        if (dbh->methods->preparer(dbh, statement, statement_len, stmt, options TSRMLS_CC)) {
-               pdo_stmt_construct(stmt, return_value, dbstmt_ce, &ctor_args TSRMLS_CC);
+               pdo_stmt_construct(execute_data, stmt, return_value, dbstmt_ce, &ctor_args TSRMLS_CC);
                return;
        }
 
@@ -1109,7 +1109,7 @@ static PHP_METHOD(PDO, query)
                                        stmt->executed = 1;
                                }
                                if (ret) {
-                                       pdo_stmt_construct(stmt, return_value, dbh->def_stmt_ce, &dbh->def_stmt_ctor_args TSRMLS_CC);
+                                       pdo_stmt_construct(execute_data, stmt, return_value, dbh->def_stmt_ce, &dbh->def_stmt_ctor_args TSRMLS_CC);
                                        return;
                                }
                        }
index 2c29229e8e30aef9d5d64487a5c48cbd7ec659e4..fc279e2d12fddafdde2ede87b1fb3c0763163448 100644 (file)
@@ -83,7 +83,7 @@ ZEND_DECLARE_MODULE_GLOBALS(reflection)
 /* Method macros */
 
 #define METHOD_NOTSTATIC(ce)                                                                                \
-       if (!Z_OBJ(EG(This)) || !instanceof_function(Z_OBJCE(EG(This)), ce TSRMLS_CC)) {           \
+       if (!Z_OBJ(EX(This)) || !instanceof_function(Z_OBJCE(EX(This)), ce TSRMLS_CC)) {           \
                php_error_docref(NULL TSRMLS_CC, E_ERROR, "%s() cannot be called statically", get_active_function_name(TSRMLS_C));        \
                return;                                                                                             \
        }                                                                                                       \
index 2b7566525d0323c72235b4eb2e2da4dc7400bacc..51c62f5cd6b8f6d8552eb637cb4342b15ac451b3 100644 (file)
@@ -78,7 +78,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
        int _old_soap_version = SOAP_GLOBAL(soap_version);\
        SOAP_GLOBAL(use_soap_error_handler) = 1;\
        SOAP_GLOBAL(error_code) = "Server";\
-       Z_OBJ(SOAP_GLOBAL(error_object)) = Z_OBJ(EG(This));
+       Z_OBJ(SOAP_GLOBAL(error_object)) = Z_OBJ(EX(This));
 
 #define SOAP_SERVER_END_CODE() \
        SOAP_GLOBAL(use_soap_error_handler) = _old_handler;\
@@ -97,7 +97,7 @@ static void soap_error_handler(int error_num, const char *error_filename, const
        int _bailout = 0;\
        SOAP_GLOBAL(use_soap_error_handler) = 1;\
        SOAP_GLOBAL(error_code) = "Client";\
-       Z_OBJ(SOAP_GLOBAL(error_object)) = Z_OBJ(EG(This));\
+       Z_OBJ(SOAP_GLOBAL(error_object)) = Z_OBJ(EX(This));\
        zend_try {
 
 #define SOAP_CLIENT_END_CODE() \
@@ -946,7 +946,7 @@ PHP_METHOD(SoapFault, __toString)
        fci.function_table = &Z_OBJCE_P(getThis())->function_table;
        ZVAL_STRINGL(&fci.function_name, "gettraceasstring", sizeof("gettraceasstring")-1);
        fci.symbol_table = NULL;
-       fci.object = Z_OBJ(EG(This));
+       fci.object = Z_OBJ(EX(This));
        fci.retval = &trace;
        fci.param_count = 0;
        fci.params = NULL;
@@ -2621,7 +2621,8 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act
   return ret;
 }
 
-static void do_soap_call(zval* this_ptr,
+static void do_soap_call(zend_execute_data *execute_data,
+                         zval* this_ptr,
                          char* function,
                          size_t function_len,
                          int arg_count,
@@ -2936,7 +2937,7 @@ PHP_METHOD(SoapClient, __call)
        if (output_headers) {
                array_init(output_headers);
        }
-       do_soap_call(this_ptr, function, function_len, arg_count, real_args, return_value, location, soap_action, uri, soap_headers, output_headers TSRMLS_CC);
+       do_soap_call(execute_data, this_ptr, function, function_len, arg_count, real_args, return_value, location, soap_action, uri, soap_headers, output_headers TSRMLS_CC);
        if (arg_count > 0) {
                efree(real_args);
        }
index d38da10e6545019f559c3f1cd0433fe21ef3592e..44078733d6664817bbb076b1d681eb44bdcdbaaa 100644 (file)
@@ -346,7 +346,7 @@ PHP_FUNCTION(spl_autoload)
                 * The "scope" is determined by an opcode, if it is ZEND_FETCH_CLASS we know function was called indirectly by
                 * the Zend engine.
                 */
-               zend_execute_data *ex = EG(current_execute_data);
+               zend_execute_data *ex = EX(prev_execute_data);
 
                while (ex && (!ex->func || !ZEND_USER_CODE(ex->func->type))) {
                        ex = ex->prev_execute_data;
index 1d9c00db0ae7fdbd44a74e7b2050c81b3485f2c9..73588ff1bd83052101f6123ebc4e02bf7e5aba77 100644 (file)
@@ -821,12 +821,12 @@ SPL_METHOD(DirectoryIterator, seek)
 
        if (intern->u.dir.index > pos) {
                /* we first rewind */
-               zend_call_method_with_0_params(&EG(This), Z_OBJCE(EG(This)), &intern->u.dir.func_rewind, "rewind", NULL);
+               zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)), &intern->u.dir.func_rewind, "rewind", NULL);
        }
 
        while (intern->u.dir.index < pos) {
                int valid = 0;
-               zend_call_method_with_0_params(&EG(This), Z_OBJCE(EG(This)), &intern->u.dir.func_valid, "valid", &retval);
+               zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)), &intern->u.dir.func_valid, "valid", &retval);
                if (!Z_ISUNDEF(retval)) {
                        valid = zend_is_true(&retval TSRMLS_CC);
                        zval_ptr_dtor(&retval);
@@ -834,7 +834,7 @@ SPL_METHOD(DirectoryIterator, seek)
                if (!valid) {
                        break;
                }
-               zend_call_method_with_0_params(&EG(This), Z_OBJCE(EG(This)), &intern->u.dir.func_next, "next", NULL);
+               zend_call_method_with_0_params(&EX(This), Z_OBJCE(EX(This)), &intern->u.dir.func_next, "next", NULL);
        }
 } /* }}} */
 
@@ -2170,7 +2170,8 @@ static int spl_filesystem_file_read_line_ex(zval * this_ptr, spl_filesystem_obje
                if (SPL_HAS_FLAG(intern->flags, SPL_FILE_OBJECT_READ_CSV)) {
                        return spl_filesystem_file_read_csv(intern, intern->u.file.delimiter, intern->u.file.enclosure, intern->u.file.escape, NULL TSRMLS_CC);
                } else {
-                       zend_call_method_with_0_params(this_ptr, Z_OBJCE_P(getThis()), &intern->u.file.func_getCurr, "getCurrentLine", &retval);
+                       zend_execute_data *execute_data = EG(current_execute_data);
+                       zend_call_method_with_0_params(this_ptr, Z_OBJCE(EX(This)), &intern->u.file.func_getCurr, "getCurrentLine", &retval);
                }
                if (!Z_ISUNDEF(retval)) {
                        if (intern->u.file.current_line || !Z_ISUNDEF(intern->u.file.current_zval)) {
index e952ad90252b22ce222ca80561f5a58f6787acc3..5bcd3d33869f92e2f5c414eff9310d947b108437 100644 (file)
@@ -4786,15 +4786,15 @@ PHP_FUNCTION(forward_static_call)
                return;
        }
 
-       if (!EG(current_execute_data)->prev_execute_data->func->common.scope) {
+       if (!EX(prev_execute_data)->func->common.scope) {
                zend_error(E_ERROR, "Cannot call forward_static_call() when no class scope is active");
        }
 
        fci.retval = &retval;
 
-       if (EG(current_execute_data)->called_scope &&
-               instanceof_function(EG(current_execute_data)->called_scope, fci_cache.calling_scope TSRMLS_CC)) {
-                       fci_cache.called_scope = EG(current_execute_data)->called_scope;
+       if (EX(called_scope) &&
+               instanceof_function(EX(called_scope), fci_cache.calling_scope TSRMLS_CC)) {
+                       fci_cache.called_scope = EX(called_scope);
        }
        
        if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
@@ -4818,9 +4818,9 @@ PHP_FUNCTION(forward_static_call_array)
        zend_fcall_info_args(&fci, params TSRMLS_CC);
        fci.retval = &retval;
 
-       if (EG(current_execute_data)->called_scope &&
-               instanceof_function(EG(current_execute_data)->called_scope, fci_cache.calling_scope TSRMLS_CC)) {
-                       fci_cache.called_scope = EG(current_execute_data)->called_scope;
+       if (EX(called_scope) &&
+               instanceof_function(EX(called_scope), fci_cache.calling_scope TSRMLS_CC)) {
+                       fci_cache.called_scope = EX(called_scope);
        }
 
        if (zend_call_function(&fci, &fci_cache TSRMLS_CC) == SUCCESS && Z_TYPE(retval) != IS_UNDEF) {
index 4574667c946bfa0da2e3c7276ef1518871d5a050..8f211d023642af70db717ca4550c6946b2c457b0 100644 (file)
@@ -378,7 +378,7 @@ php_formatted_print(int param_count, int use_array, int format_offset TSRMLS_DC)
        int always_sign;
        int format_len;
 
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "+", &args, &argc) == FAILURE) {
+       if (zend_parse_parameters(param_count TSRMLS_CC, "+", &args, &argc) == FAILURE) {
                return NULL;
        }