diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2018-10-13 15:30:27 +0200 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2018-10-16 20:53:59 +0200 |
commit | 1cfbb21790ff6dd4931223c5bdc18a0cebf3ffd4 (patch) | |
tree | 9fc9117f49dc0ad1dd6cd22d04d6068dcbf90902 | |
parent | fc0aa264c1bbe7304619e73940484b39ed39af2c (diff) | |
download | php-git-1cfbb21790ff6dd4931223c5bdc18a0cebf3ffd4.tar.gz |
Classify object handlers are required/optional
-rw-r--r-- | UPGRADING.INTERNALS | 23 | ||||
-rw-r--r-- | Zend/zend_API.c | 15 | ||||
-rw-r--r-- | Zend/zend_builtin_functions.c | 3 | ||||
-rw-r--r-- | Zend/zend_execute.c | 345 | ||||
-rw-r--r-- | Zend/zend_gc.c | 48 | ||||
-rw-r--r-- | Zend/zend_object_handlers.h | 59 | ||||
-rw-r--r-- | Zend/zend_objects_API.c | 28 | ||||
-rw-r--r-- | Zend/zend_vm_def.h | 95 | ||||
-rw-r--r-- | Zend/zend_vm_execute.h | 1203 | ||||
-rw-r--r-- | ext/com_dotnet/com_handlers.c | 2 | ||||
-rw-r--r-- | ext/reflection/php_reflection.c | 2 | ||||
-rw-r--r-- | ext/spl/spl_iterators.c | 6 | ||||
-rw-r--r-- | ext/standard/array.c | 4 |
13 files changed, 607 insertions, 1226 deletions
diff --git a/UPGRADING.INTERNALS b/UPGRADING.INTERNALS index 505b3686aa..132a2d97a7 100644 --- a/UPGRADING.INTERNALS +++ b/UPGRADING.INTERNALS @@ -7,6 +7,7 @@ PHP 7.4 INTERNALS UPGRADE NOTES d. Removed zend_check_private() e. php_win32_error_to_msg() memory management f. get_properties_for() handler / Z_OBJDEBUG_P + g. Required object handlers 2. Build system changes a. Abstract @@ -98,6 +99,28 @@ PHP 7.4 INTERNALS UPGRADE NOTES // ... zend_release_properties(ht); + g. The following object handlers are now required (must be non-NULL): + + * free_obj + * dtor_obj + * read_property + * write_property + * read_dimension + * write_dimension + * get_property_ptr_ptr + * has_property + * unset_property + * has_dimension + * unset_dimension + * get_properties + * get_method + * get_constructor + * get_class_name + * get_gc + + It is recommended to initialize object handler structures by copying the + std object handlers and only overwriting those you want to change. + ======================== 2. Build system changes ======================== diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 81a4ee7698..47a674cc13 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3114,7 +3114,7 @@ get_function_via_handler: fcc->function_handler = zend_get_call_trampoline_func(ce_org, mname, 0); call_via_handler = 1; retval = 1; - } else if (fcc->object->handlers->get_method) { + } else { fcc->function_handler = fcc->object->handlers->get_method(&fcc->object, mname, NULL); if (fcc->function_handler) { if (strict_class && @@ -3935,9 +3935,6 @@ ZEND_API void zend_update_property_ex(zend_class_entry *scope, zval *object, zen EG(fake_scope) = scope; - if (!Z_OBJ_HT_P(object)->write_property) { - zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be updated", ZSTR_VAL(name), ZSTR_VAL(Z_OBJCE_P(object)->name)); - } ZVAL_STR(&property, name); Z_OBJ_HT_P(object)->write_property(object, &property, value, NULL); @@ -3952,9 +3949,6 @@ ZEND_API void zend_update_property(zend_class_entry *scope, zval *object, const EG(fake_scope) = scope; - if (!Z_OBJ_HT_P(object)->write_property) { - zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be updated", name, ZSTR_VAL(Z_OBJCE_P(object)->name)); - } ZVAL_STRINGL(&property, name, name_length); Z_OBJ_HT_P(object)->write_property(object, &property, value, NULL); zval_ptr_dtor(&property); @@ -3979,9 +3973,6 @@ ZEND_API void zend_unset_property(zend_class_entry *scope, zval *object, const c EG(fake_scope) = scope; - if (!Z_OBJ_HT_P(object)->unset_property) { - zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be unset", name, ZSTR_VAL(Z_OBJCE_P(object)->name)); - } ZVAL_STRINGL(&property, name, name_length); Z_OBJ_HT_P(object)->unset_property(object, &property, 0); zval_ptr_dtor(&property); @@ -4143,10 +4134,6 @@ ZEND_API zval *zend_read_property_ex(zend_class_entry *scope, zval *object, zend EG(fake_scope) = scope; - if (!Z_OBJ_HT_P(object)->read_property) { - zend_error_noreturn(E_CORE_ERROR, "Property %s of class %s cannot be read", ZSTR_VAL(name), ZSTR_VAL(Z_OBJCE_P(object)->name)); - } - ZVAL_STR(&property, name); value = Z_OBJ_HT_P(object)->read_property(object, &property, silent?BP_VAR_IS:BP_VAR_R, NULL, rv); diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 364d478ab7..1ff32cc355 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1338,7 +1338,7 @@ ZEND_FUNCTION(method_exists) if (zend_hash_exists(&ce->function_table, lcname)) { zend_string_release_ex(lcname, 0); RETURN_TRUE; - } else if (Z_TYPE_P(klass) == IS_OBJECT && Z_OBJ_HT_P(klass)->get_method != NULL) { + } else if (Z_TYPE_P(klass) == IS_OBJECT) { zend_object *obj = Z_OBJ_P(klass); zend_function *func = Z_OBJ_HT_P(klass)->get_method(&obj, method_name, NULL); if (func != NULL) { @@ -1401,7 +1401,6 @@ ZEND_FUNCTION(property_exists) ZVAL_STR(&property_z, property); if (Z_TYPE_P(object) == IS_OBJECT && - Z_OBJ_HANDLER_P(object, has_property) && Z_OBJ_HANDLER_P(object, has_property)(object, &property_z, 2, NULL)) { RETURN_TRUE; } diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index cbaa53f4e1..66ff7abfcd 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -625,17 +625,6 @@ static zend_never_inline ZEND_COLD int zend_wrong_assign_to_variable_reference(z return 1; } -static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_assignment(zval *property OPLINE_DC EXECUTE_DATA_DC) -{ - zend_string *tmp_property_name; - zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name); - zend_error(E_WARNING, "Attempt to assign property '%s' of non-object", ZSTR_VAL(property_name)); - zend_tmp_string_release(tmp_property_name); - if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(EX_VAR(opline->result.var)); - } -} - /* this should modify object only if it's empty */ static zend_never_inline ZEND_COLD int ZEND_FASTCALL make_real_object(zval *object, zval *property OPLINE_DC EXECUTE_DATA_DC) { @@ -1112,14 +1101,6 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_illegal_offset(void) static zend_never_inline void zend_assign_to_object_dim(zval *object, zval *dim, zval *value OPLINE_DC EXECUTE_DATA_DC) { - if (UNEXPECTED(!Z_OBJ_HT_P(object)->write_dimension)) { - zend_use_object_as_array(); - if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_UNDEF(EX_VAR(opline->result.var)); - } - return; - } - Z_OBJ_HT_P(object)->write_dimension(object, dim, value); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { @@ -1132,8 +1113,7 @@ static zend_never_inline void zend_binary_assign_op_obj_dim(zval *object, zval * zval *z; zval rv, res; - if (Z_OBJ_HT_P(object)->read_dimension && - (z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R, &rv)) != NULL) { + if ((z = Z_OBJ_HT_P(object)->read_dimension(object, property, BP_VAR_R, &rv)) != NULL) { if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { zval rv2; @@ -1335,22 +1315,6 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_read(z zend_tmp_string_release(tmp_property_name); } -static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_unset(zval *property) -{ - zend_string *tmp_property_name; - zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name); - zend_error(E_NOTICE, "Trying to unset property '%s' of non-object", ZSTR_VAL(property_name)); - zend_tmp_string_release(tmp_property_name); -} - -static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_wrong_property_check(zval *property) -{ - zend_string *tmp_property_name; - zend_string *property_name = zval_get_tmp_string(property, &tmp_property_name); - zend_error(E_NOTICE, "Trying to check property '%s' of non-object", ZSTR_VAL(property_name)); - zend_tmp_string_release(tmp_property_name); -} - static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_deprecated_function(const zend_function *fbc) { zend_error(E_DEPRECATED, "Function %s%s%s() is deprecated", @@ -1425,93 +1389,80 @@ static zend_never_inline void zend_assign_to_string_offset(zval *str, zval *dim, static zend_never_inline void zend_post_incdec_overloaded_property(zval *object, zval *property, void **cache_slot, int inc OPLINE_DC EXECUTE_DATA_DC) { - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval rv, obj; - zval *z; - zval z_copy; + zval rv, obj; + zval *z; + zval z_copy; - ZVAL_OBJ(&obj, Z_OBJ_P(object)); - Z_ADDREF(obj); - z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv); - if (UNEXPECTED(EG(exception))) { - OBJ_RELEASE(Z_OBJ(obj)); - ZVAL_UNDEF(EX_VAR(opline->result.var)); - return; - } + ZVAL_OBJ(&obj, Z_OBJ_P(object)); + Z_ADDREF(obj); + z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv); + if (UNEXPECTED(EG(exception))) { + OBJ_RELEASE(Z_OBJ(obj)); + ZVAL_UNDEF(EX_VAR(opline->result.var)); + return; + } - if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) { - zval rv2; - zval *value = Z_OBJ_HT_P(z)->get(z, &rv2); - if (z == &rv) { - zval_ptr_dtor(&rv); - } - ZVAL_COPY_VALUE(z, value); + if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) { + zval rv2; + zval *value = Z_OBJ_HT_P(z)->get(z, &rv2); + if (z == &rv) { + zval_ptr_dtor(&rv); } + ZVAL_COPY_VALUE(z, value); + } - ZVAL_COPY_DEREF(&z_copy, z); - ZVAL_COPY(EX_VAR(opline->result.var), &z_copy); - if (inc) { - increment_function(&z_copy); - } else { - decrement_function(&z_copy); - } - Z_OBJ_HT(obj)->write_property(&obj, property, &z_copy, cache_slot); - OBJ_RELEASE(Z_OBJ(obj)); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(z); + ZVAL_COPY_DEREF(&z_copy, z); + ZVAL_COPY(EX_VAR(opline->result.var), &z_copy); + if (inc) { + increment_function(&z_copy); } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - ZVAL_NULL(EX_VAR(opline->result.var)); + decrement_function(&z_copy); } + Z_OBJ_HT(obj)->write_property(&obj, property, &z_copy, cache_slot); + OBJ_RELEASE(Z_OBJ(obj)); + zval_ptr_dtor(&z_copy); + zval_ptr_dtor(z); } static zend_never_inline void zend_pre_incdec_overloaded_property(zval *object, zval *property, void **cache_slot, int inc OPLINE_DC EXECUTE_DATA_DC) { zval rv; + zval *z, obj; + zval z_copy; - if (Z_OBJ_HT_P(object)->read_property && Z_OBJ_HT_P(object)->write_property) { - zval *z, obj; - zval z_copy; - - ZVAL_OBJ(&obj, Z_OBJ_P(object)); - Z_ADDREF(obj); - z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv); - if (UNEXPECTED(EG(exception))) { - OBJ_RELEASE(Z_OBJ(obj)); - if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(EX_VAR(opline->result.var)); - } - return; + ZVAL_OBJ(&obj, Z_OBJ_P(object)); + Z_ADDREF(obj); + z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv); + if (UNEXPECTED(EG(exception))) { + OBJ_RELEASE(Z_OBJ(obj)); + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_NULL(EX_VAR(opline->result.var)); } + return; + } - if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) { - zval rv2; - zval *value = Z_OBJ_HT_P(z)->get(z, &rv2); + if (UNEXPECTED(Z_TYPE_P(z) == IS_OBJECT) && Z_OBJ_HT_P(z)->get) { + zval rv2; + zval *value = Z_OBJ_HT_P(z)->get(z, &rv2); - if (z == &rv) { - zval_ptr_dtor(&rv); - } - ZVAL_COPY_VALUE(z, value); - } - ZVAL_COPY_DEREF(&z_copy, z); - if (inc) { - increment_function(&z_copy); - } else { - decrement_function(&z_copy); - } - if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(EX_VAR(opline->result.var), &z_copy); + if (z == &rv) { + zval_ptr_dtor(&rv); } - Z_OBJ_HT(obj)->write_property(&obj, property, &z_copy, cache_slot); - OBJ_RELEASE(Z_OBJ(obj)); - zval_ptr_dtor(&z_copy); - zval_ptr_dtor(z); + ZVAL_COPY_VALUE(z, value); + } + ZVAL_COPY_DEREF(&z_copy, z); + if (inc) { + increment_function(&z_copy); } else { - zend_error(E_WARNING, "Attempt to increment/decrement property of non-object"); - if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(EX_VAR(opline->result.var)); - } + decrement_function(&z_copy); } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), &z_copy); + } + Z_OBJ_HT(obj)->write_property(&obj, property, &z_copy, cache_slot); + OBJ_RELEASE(Z_OBJ(obj)); + zval_ptr_dtor(&z_copy); + zval_ptr_dtor(z); } static zend_never_inline void zend_assign_op_overloaded_property(zval *object, zval *property, void **cache_slot, zval *value, binary_op_type binary_op OPLINE_DC EXECUTE_DATA_DC) @@ -1521,38 +1472,31 @@ static zend_never_inline void zend_assign_op_overloaded_property(zval *object, z ZVAL_OBJ(&obj, Z_OBJ_P(object)); Z_ADDREF(obj); - if (EXPECTED(Z_OBJ_HT(obj)->read_property)) { - z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv); - if (UNEXPECTED(EG(exception))) { - OBJ_RELEASE(Z_OBJ(obj)); - if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_UNDEF(EX_VAR(opline->result.var)); - } - return; - } - if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { - zval rv2; - zval *value = Z_OBJ_HT_P(z)->get(z, &rv2); - - if (z == &rv) { - zval_ptr_dtor(&rv); - } - ZVAL_COPY_VALUE(z, value); - } - if (binary_op(&res, z, value) == SUCCESS) { - Z_OBJ_HT(obj)->write_property(&obj, property, &res, cache_slot); - } + z = Z_OBJ_HT(obj)->read_property(&obj, property, BP_VAR_R, cache_slot, &rv); + if (UNEXPECTED(EG(exception))) { + OBJ_RELEASE(Z_OBJ(obj)); if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_COPY(EX_VAR(opline->result.var), &res); + ZVAL_UNDEF(EX_VAR(opline->result.var)); } - zval_ptr_dtor(z); - zval_ptr_dtor(&res); - } else { - zend_error(E_WARNING, "Attempt to assign property of non-object"); - if (UNEXPECTED(RETURN_VALUE_USED(opline))) { - ZVAL_NULL(EX_VAR(opline->result.var)); + return; + } + if (Z_TYPE_P(z) == IS_OBJECT && Z_OBJ_HT_P(z)->get) { + zval rv2; + zval *value = Z_OBJ_HT_P(z)->get(z, &rv2); + + if (z == &rv) { + zval_ptr_dtor(&rv); } + ZVAL_COPY_VALUE(z, value); } + if (binary_op(&res, z, value) == SUCCESS) { + Z_OBJ_HT(obj)->write_property(&obj, property, &res, cache_slot); + } + if (UNEXPECTED(RETURN_VALUE_USED(opline))) { + ZVAL_COPY(EX_VAR(opline->result.var), &res); + } + zval_ptr_dtor(z); + zval_ptr_dtor(&res); OBJ_RELEASE(Z_OBJ(obj)); } @@ -1660,16 +1604,6 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_use_new_element_for_s zend_throw_error(NULL, "[] operator not supported for strings"); } -static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_access_undefined_propery_in_overloaded_object(void) -{ - zend_throw_error(NULL, "Cannot access undefined property for object with overloaded property access"); -} - -static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_unsupported_property_reference(void) -{ - zend_error(E_WARNING, "This object doesn't support property references"); -} - static zend_always_inline zval *zend_fetch_dimension_address_inner(HashTable *ht, const zval *dim, int dim_type, int type EXECUTE_DATA_DC) { zval *retval = NULL; @@ -1844,39 +1778,34 @@ fetch_from_array: zval_undefined_cv(EX(opline)->op2.var EXECUTE_DATA_CC); dim = &EG(uninitialized_zval); } - if (!Z_OBJ_HT_P(container)->read_dimension) { - zend_use_object_as_array(); - ZVAL_ERROR(result); - } else { - if (dim_type == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { - dim++; - } - retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result); + if (dim_type == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result); - if (UNEXPECTED(retval == &EG(uninitialized_zval))) { - zend_class_entry *ce = Z_OBJCE_P(container); + if (UNEXPECTED(retval == &EG(uninitialized_zval))) { + zend_class_entry *ce = Z_OBJCE_P(container); - ZVAL_NULL(result); - zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ZSTR_VAL(ce->name)); - } else if (EXPECTED(retval && Z_TYPE_P(retval) != IS_UNDEF)) { - if (!Z_ISREF_P(retval)) { - if (result != retval) { - ZVAL_COPY(result, retval); - retval = result; - } - if (Z_TYPE_P(retval) != IS_OBJECT) { - zend_class_entry *ce = Z_OBJCE_P(container); - zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ZSTR_VAL(ce->name)); - } - } else if (UNEXPECTED(Z_REFCOUNT_P(retval) == 1)) { - ZVAL_UNREF(retval); - } + ZVAL_NULL(result); + zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ZSTR_VAL(ce->name)); + } else if (EXPECTED(retval && Z_TYPE_P(retval) != IS_UNDEF)) { + if (!Z_ISREF_P(retval)) { if (result != retval) { - ZVAL_INDIRECT(result, retval); + ZVAL_COPY(result, retval); + retval = result; } - } else { - ZVAL_ERROR(result); + if (Z_TYPE_P(retval) != IS_OBJECT) { + zend_class_entry *ce = Z_OBJCE_P(container); + zend_error(E_NOTICE, "Indirect modification of overloaded element of %s has no effect", ZSTR_VAL(ce->name)); + } + } else if (UNEXPECTED(Z_REFCOUNT_P(retval) == 1)) { + ZVAL_UNREF(retval); } + if (result != retval) { + ZVAL_INDIRECT(result, retval); + } + } else { + ZVAL_ERROR(result); } } else { if (type != BP_VAR_W && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { @@ -2004,25 +1933,20 @@ try_string_offset: zval_undefined_cv(EX(opline)->op2.var EXECUTE_DATA_CC); dim = &EG(uninitialized_zval); } - if (!Z_OBJ_HT_P(container)->read_dimension) { - zend_use_object_as_array(); - ZVAL_NULL(result); - } else { - if (dim_type == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { - dim++; - } - retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result); + if (dim_type == IS_CONST && Z_EXTRA_P(dim) == ZEND_EXTRA_VALUE) { + dim++; + } + retval = Z_OBJ_HT_P(container)->read_dimension(container, dim, type, result); - ZEND_ASSERT(result != NULL); - if (retval) { - if (result != retval) { - ZVAL_COPY_DEREF(result, retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(result); - } - } else { - ZVAL_NULL(result); + ZEND_ASSERT(result != NULL); + if (retval) { + if (result != retval) { + ZVAL_COPY_DEREF(result, retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(result); } + } else { + ZVAL_NULL(result); } } else { if (type != BP_VAR_IS && UNEXPECTED(Z_TYPE_P(container) == IS_UNDEF)) { @@ -2101,12 +2025,7 @@ static zend_never_inline int ZEND_FASTCALL zend_isset_dim_slow(zval *container, } if (/*OP1_TYPE != IS_CONST &&*/ EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { - if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { - return Z_OBJ_HT_P(container)->has_dimension(container, offset, 0); - } else { - zend_use_object_as_array(); - return 0; - } + return Z_OBJ_HT_P(container)->has_dimension(container, offset, 0); } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */ zend_long lval; @@ -2146,12 +2065,7 @@ static zend_never_inline int ZEND_FASTCALL zend_isempty_dim_slow(zval *container } if (/*OP1_TYPE != IS_CONST &&*/ EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { - if (EXPECTED(Z_OBJ_HT_P(container)->has_dimension)) { - return !Z_OBJ_HT_P(container)->has_dimension(container, offset, 1); - } else { - zend_use_object_as_array(); - return 1; - } + return !Z_OBJ_HT_P(container)->has_dimension(container, offset, 1); } else if (EXPECTED(Z_TYPE_P(container) == IS_STRING)) { /* string offsets */ zend_long lval; @@ -2185,6 +2099,7 @@ str_offset: static zend_always_inline void zend_fetch_property_address(zval *result, zval *container, uint32_t container_op_type, zval *prop_ptr, uint32_t prop_op_type, void **cache_slot, int type OPLINE_DC) { + zval *ptr; if (container_op_type != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { do { if (Z_ISREF_P(container)) { @@ -2228,29 +2143,17 @@ static zend_always_inline void zend_fetch_property_address(zval *result, zval *c } } } - if (EXPECTED(Z_OBJ_HT_P(container)->get_property_ptr_ptr)) { - zval *ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr, type, cache_slot); - if (NULL == ptr) { - if (EXPECTED(Z_OBJ_HT_P(container)->read_property)) { -use_read_property: - ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result); - if (ptr != result) { - ZVAL_INDIRECT(result, ptr); - } else if (UNEXPECTED(Z_ISREF_P(ptr) && Z_REFCOUNT_P(ptr) == 1)) { - ZVAL_UNREF(ptr); - } - } else { - zend_access_undefined_propery_in_overloaded_object(); - ZVAL_ERROR(result); - } - } else { + + ptr = Z_OBJ_HT_P(container)->get_property_ptr_ptr(container, prop_ptr, type, cache_slot); + if (NULL == ptr) { + ptr = Z_OBJ_HT_P(container)->read_property(container, prop_ptr, type, cache_slot, result); + if (ptr != result) { ZVAL_INDIRECT(result, ptr); + } else if (UNEXPECTED(Z_ISREF_P(ptr) && Z_REFCOUNT_P(ptr) == 1)) { + ZVAL_UNREF(ptr); } - } else if (EXPECTED(Z_OBJ_HT_P(container)->read_property)) { - goto use_read_property; } else { - zend_unsupported_property_reference(); - ZVAL_ERROR(result); + ZVAL_INDIRECT(result, ptr); } } diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c index 1732fdefc4..15a594da60 100644 --- a/Zend/zend_gc.c +++ b/Zend/zend_gc.c @@ -617,17 +617,15 @@ tail_call: GC_REF_SET_BLACK(ref); if (GC_TYPE(ref) == IS_OBJECT) { - zend_object_get_gc_t get_gc; zend_object *obj = (zend_object*)ref; - if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) && - (get_gc = obj->handlers->get_gc) != NULL)) { + if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED))) { int n; zval *zv, *end; zval tmp; ZVAL_OBJ(&tmp, obj); - ht = get_gc(&tmp, &zv, &n); + ht = obj->handlers->get_gc(&tmp, &zv, &n); end = zv + n; if (EXPECTED(!ht)) { if (!n) return; @@ -727,17 +725,15 @@ tail_call: GC_REF_SET_COLOR(ref, GC_GREY); if (GC_TYPE(ref) == IS_OBJECT) { - zend_object_get_gc_t get_gc; zend_object *obj = (zend_object*)ref; - if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) && - (get_gc = obj->handlers->get_gc) != NULL)) { + if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED))) { int n; zval *zv, *end; zval tmp; ZVAL_OBJ(&tmp, obj); - ht = get_gc(&tmp, &zv, &n); + ht = obj->handlers->get_gc(&tmp, &zv, &n); end = zv + n; if (EXPECTED(!ht)) { if (!n) return; @@ -883,17 +879,15 @@ tail_call: } else { GC_REF_SET_COLOR(ref, GC_WHITE); if (GC_TYPE(ref) == IS_OBJECT) { - zend_object_get_gc_t get_gc; zend_object *obj = (zend_object*)ref; - if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) && - (get_gc = obj->handlers->get_gc) != NULL)) { + if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED))) { int n; zval *zv, *end; zval tmp; ZVAL_OBJ(&tmp, obj); - ht = get_gc(&tmp, &zv, &n); + ht = obj->handlers->get_gc(&tmp, &zv, &n); end = zv + n; if (EXPECTED(!ht)) { if (!n) return; @@ -1023,11 +1017,9 @@ tail_call: } if (GC_TYPE(ref) == IS_OBJECT) { - zend_object_get_gc_t get_gc; zend_object *obj = (zend_object*)ref; - if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) && - (get_gc = obj->handlers->get_gc) != NULL)) { + if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED))) { int n; zval *zv, *end; zval tmp; @@ -1036,13 +1028,12 @@ tail_call: if (!GC_INFO(ref)) { gc_add_garbage(ref); } - if (obj->handlers->dtor_obj && - ((obj->handlers->dtor_obj != zend_objects_destroy_object) || - (obj->ce->destructor != NULL))) { + if (obj->handlers->dtor_obj != zend_objects_destroy_object || + obj->ce->destructor != NULL) { *flags |= GC_HAS_DESTRUCTORS; } ZVAL_OBJ(&tmp, obj); - ht = get_gc(&tmp, &zv, &n); + ht = obj->handlers->get_gc(&tmp, &zv, &n); end = zv + n; if (EXPECTED(!ht)) { if (!n) return count; @@ -1193,17 +1184,15 @@ tail_call: } if (GC_TYPE(ref) == IS_OBJECT) { - zend_object_get_gc_t get_gc; zend_object *obj = (zend_object*)ref; - if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED) && - (get_gc = obj->handlers->get_gc) != NULL)) { + if (EXPECTED(!(OBJ_FLAGS(ref) & IS_OBJ_FREE_CALLED))) { int n; zval *zv, *end; zval tmp; ZVAL_OBJ(&tmp, obj); - ht = get_gc(&tmp, &zv, &n); + ht = obj->handlers->get_gc(&tmp, &zv, &n); end = zv + n; if (EXPECTED(!ht)) { if (!n) return; @@ -1341,9 +1330,8 @@ ZEND_API int zend_gc_collect_cycles(void) GC_TRACE_REF(obj, "calling destructor"); GC_ADD_FLAGS(obj, IS_OBJ_DESTRUCTOR_CALLED); - if (obj->handlers->dtor_obj - && (obj->handlers->dtor_obj != zend_objects_destroy_object - || obj->ce->destructor)) { + if (obj->handlers->dtor_obj != zend_objects_destroy_object + || obj->ce->destructor) { GC_ADDREF(obj); obj->handlers->dtor_obj(obj); GC_DELREF(obj); @@ -1392,11 +1380,9 @@ ZEND_API int zend_gc_collect_cycles(void) (GC_TYPE_INFO(obj) & ~GC_TYPE_MASK); if (!(OBJ_FLAGS(obj) & IS_OBJ_FREE_CALLED)) { GC_ADD_FLAGS(obj, IS_OBJ_FREE_CALLED); - if (obj->handlers->free_obj) { - GC_ADDREF(obj); - obj->handlers->free_obj(obj); - GC_DELREF(obj); - } + GC_ADDREF(obj); + obj->handlers->free_obj(obj); + GC_DELREF(obj); } ZEND_OBJECTS_STORE_ADD_TO_FREE_LIST(obj->handle); diff --git a/Zend/zend_object_handlers.h b/Zend/zend_object_handlers.h index 83a22c4d2b..2f94ba1cb6 100644 --- a/Zend/zend_object_handlers.h +++ b/Zend/zend_object_handlers.h @@ -153,36 +153,35 @@ typedef int (*zend_object_do_operation_t)(zend_uchar opcode, zval *result, zval struct _zend_object_handlers { /* offset of real object header (usually zero) */ int offset; - /* general object functions */ - zend_object_free_obj_t free_obj; - zend_object_dtor_obj_t dtor_obj; - zend_object_clone_obj_t clone_obj; - /* individual object functions */ - zend_object_read_property_t read_property; - zend_object_write_property_t write_property; - zend_object_read_dimension_t read_dimension; - zend_object_write_dimension_t write_dimension; - zend_object_get_property_ptr_ptr_t get_property_ptr_ptr; - zend_object_get_t get; - zend_object_set_t set; - zend_object_has_property_t has_property; - zend_object_unset_property_t unset_property; - zend_object_has_dimension_t has_dimension; - zend_object_unset_dimension_t unset_dimension; - zend_object_get_properties_t get_properties; /* required */ - zend_object_get_method_t get_method; - zend_object_call_method_t call_method; - zend_object_get_constructor_t get_constructor; - zend_object_get_class_name_t get_class_name; - zend_object_compare_t compare_objects; - zend_object_cast_t cast_object; - zend_object_count_elements_t count_elements; - zend_object_get_debug_info_t get_debug_info; - zend_object_get_closure_t get_closure; - zend_object_get_gc_t get_gc; - zend_object_do_operation_t do_operation; - zend_object_compare_zvals_t compare; - zend_object_get_properties_for_t get_properties_for; /* optional */ + /* object handlers */ + zend_object_free_obj_t free_obj; /* required */ + zend_object_dtor_obj_t dtor_obj; /* required */ + zend_object_clone_obj_t clone_obj; /* optional */ + zend_object_read_property_t read_property; /* required */ + zend_object_write_property_t write_property; /* required */ + zend_object_read_dimension_t read_dimension; /* required */ + zend_object_write_dimension_t write_dimension; /* required */ + zend_object_get_property_ptr_ptr_t get_property_ptr_ptr; /* required */ + zend_object_get_t get; /* optional */ + zend_object_set_t set; /* optional */ + zend_object_has_property_t has_property; /* required */ + zend_object_unset_property_t unset_property; /* required */ + zend_object_has_dimension_t has_dimension; /* required */ + zend_object_unset_dimension_t unset_dimension; /* required */ + zend_object_get_properties_t get_properties; /* required */ + zend_object_get_method_t get_method; /* required */ + zend_object_call_method_t call_method; /* optional */ + zend_object_get_constructor_t get_constructor; /* required */ + zend_object_get_class_name_t get_class_name; /* required */ + zend_object_compare_t compare_objects; /* optional */ + zend_object_cast_t cast_object; /* optional */ + zend_object_count_elements_t count_elements; /* optional */ + zend_object_get_debug_info_t get_debug_info; /* optional */ + zend_object_get_closure_t get_closure; /* optional */ + zend_object_get_gc_t get_gc; /* required */ + zend_object_do_operation_t do_operation; /* optional */ + zend_object_compare_zvals_t compare; /* optional */ + zend_object_get_properties_for_t get_properties_for; /* optional */ }; BEGIN_EXTERN_C() diff --git a/Zend/zend_objects_API.c b/Zend/zend_objects_API.c index 672a580caa..23c8842411 100644 --- a/Zend/zend_objects_API.c +++ b/Zend/zend_objects_API.c @@ -49,9 +49,8 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_call_destructors(zend_objects_sto if (!(OBJ_FLAGS(obj) & IS_OBJ_DESTRUCTOR_CALLED)) { GC_ADD_FLAGS(obj, IS_OBJ_DESTRUCTOR_CALLED); - if (obj->handlers->dtor_obj - && (obj->handlers->dtor_obj != zend_objects_destroy_object - || obj->ce->destructor)) { + if (obj->handlers->dtor_obj != zend_objects_destroy_object + || obj->ce->destructor) { GC_ADDREF(obj); obj->handlers->dtor_obj(obj); GC_DELREF(obj); @@ -98,7 +97,7 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_free_object_storage(zend_objects_ if (IS_OBJ_VALID(obj)) { if (!(OBJ_FLAGS(obj) & IS_OBJ_FREE_CALLED)) { GC_ADD_FLAGS(obj, IS_OBJ_FREE_CALLED); - if (obj->handlers->free_obj && obj->handlers->free_obj != zend_object_std_dtor) { + if (obj->handlers->free_obj != zend_object_std_dtor) { GC_ADDREF(obj); obj->handlers->free_obj(obj); GC_DELREF(obj); @@ -113,11 +112,9 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_free_object_storage(zend_objects_ if (IS_OBJ_VALID(obj)) { if (!(OBJ_FLAGS(obj) & IS_OBJ_FREE_CALLED)) { GC_ADD_FLAGS(obj, IS_OBJ_FREE_CALLED); - if (obj->handlers->free_obj) { - GC_ADDREF(obj); - obj->handlers->free_obj(obj); - GC_DELREF(obj); - } + GC_ADDREF(obj); + obj->handlers->free_obj(obj); + GC_DELREF(obj); } } } while (obj_ptr != end); @@ -163,9 +160,8 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_del(zend_object *object) /* {{{ * if (!(OBJ_FLAGS(object) & IS_OBJ_DESTRUCTOR_CALLED)) { GC_ADD_FLAGS(object, IS_OBJ_DESTRUCTOR_CALLED); - if (object->handlers->dtor_obj - && (object->handlers->dtor_obj != zend_objects_destroy_object - || object->ce->destructor)) { + if (object->handlers->dtor_obj != zend_objects_destroy_object + || object->ce->destructor) { GC_ADDREF(object); object->handlers->dtor_obj(object); GC_DELREF(object); @@ -179,11 +175,9 @@ ZEND_API void ZEND_FASTCALL zend_objects_store_del(zend_object *object) /* {{{ * EG(objects_store).object_buckets[handle] = SET_OBJ_INVALID(object); if (!(OBJ_FLAGS(object) & IS_OBJ_FREE_CALLED)) { GC_ADD_FLAGS(object, IS_OBJ_FREE_CALLED); - if (object->handlers->free_obj) { - GC_ADDREF(object); - object->handlers->free_obj(object); - GC_DELREF(object); - } + GC_ADDREF(object); + object->handlers->free_obj(object); + GC_DELREF(object); } ptr = ((char*)object) - object->handlers->offset; GC_REMOVE_FROM_BUFFER(object); diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 36fb9a1779..23332f9415 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -822,8 +822,7 @@ ZEND_VM_HELPER(zend_binary_assign_op_obj_helper, VAR|UNUSED|CV, CONST|TMPVAR|CV, /* here we are sure we are dealing with an object */ ZEND_VM_C_LABEL(assign_op_object): - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -1084,8 +1083,7 @@ ZEND_VM_HELPER(zend_pre_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|CV, /* here we are sure we are dealing with an object */ ZEND_VM_C_LABEL(pre_incdec_object): - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -1162,8 +1160,7 @@ ZEND_VM_HELPER(zend_post_incdec_property_helper, VAR|UNUSED|CV, CONST|TMPVAR|CV, /* here we are sure we are dealing with an object */ ZEND_VM_C_LABEL(post_incdec_object): - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -1795,7 +1792,9 @@ ZEND_VM_HOT_OBJ_HANDLER(82, ZEND_FETCH_OBJ_R, CONST|TMPVAR|UNUSED|THIS|CV, CONST if (OP2_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - ZEND_VM_C_GOTO(fetch_obj_r_no_object); + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + ZEND_VM_C_GOTO(fetch_obj_r_finish); } while (0); } @@ -1847,21 +1846,16 @@ ZEND_VM_HOT_OBJ_HANDLER(82, ZEND_FETCH_OBJ_R, CONST|TMPVAR|UNUSED|THIS|CV, CONST GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -ZEND_VM_C_LABEL(fetch_obj_r_no_object): - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +ZEND_VM_C_LABEL(fetch_obj_r_finish): FREE_OP2(); FREE_OP1(); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -1939,7 +1933,8 @@ ZEND_VM_COLD_CONST_HANDLER(91, ZEND_FETCH_OBJ_IS, CONST|TMPVAR|UNUSED|THIS|CV, C break; } } - ZEND_VM_C_GOTO(fetch_obj_is_no_object); + ZVAL_NULL(EX_VAR(opline->result.var)); + ZEND_VM_C_GOTO(fetch_obj_is_finish); } while (0); } @@ -1989,19 +1984,14 @@ ZEND_VM_COLD_CONST_HANDLER(91, ZEND_FETCH_OBJ_IS, CONST|TMPVAR|UNUSED|THIS|CV, C } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -ZEND_VM_C_LABEL(fetch_obj_is_no_object): - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +ZEND_VM_C_LABEL(fetch_obj_is_finish): FREE_OP2(); FREE_OP1(); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -2179,12 +2169,6 @@ ZEND_VM_C_LABEL(fast_assign_obj): } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - FREE_OP_DATA(); - ZEND_VM_C_GOTO(exit_assign_obj); - } - if (OP_DATA_TYPE == IS_CV || OP_DATA_TYPE == IS_VAR) { ZVAL_DEREF(value); } @@ -3072,13 +3056,6 @@ ZEND_VM_HOT_OBJ_HANDLER(112, ZEND_INIT_METHOD_CALL, CONST|TMPVAR|UNUSED|THIS|CV, } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - FREE_OP2(); - FREE_OP1(); - HANDLE_EXCEPTION(); - } - if (OP2_TYPE == IS_CONST) { function_name = GET_OP2_ZVAL_PTR_UNDEF(BP_VAR_R); } @@ -5599,14 +5576,10 @@ ZEND_VM_C_LABEL(num_index_dim): offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); } if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { - if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_use_object_as_array(); - } else { - if (OP2_TYPE == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { - offset++; - } - Z_OBJ_HT_P(container)->unset_dimension(container, offset); + if (OP2_TYPE == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; } + Z_OBJ_HT_P(container)->unset_dimension(container, offset); } else if (OP1_TYPE != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_throw_error(NULL, "Cannot unset string offsets"); } @@ -5642,11 +5615,7 @@ ZEND_VM_HANDLER(76, ZEND_UNSET_OBJ, VAR|UNUSED|THIS|CV, CONST|TMPVAR|CV, CACHE_S break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); FREE_OP2(); @@ -6367,22 +6336,20 @@ ZEND_VM_COLD_CONST_HANDLER(148, ZEND_ISSET_ISEMPTY_PROP_OBJ, CONST|TMPVAR|UNUSED if ((OP1_TYPE & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - ZEND_VM_C_GOTO(isset_no_object); + result = (opline->extended_value & ZEND_ISEMPTY); + ZEND_VM_C_GOTO(isset_object_finish); } } else { - ZEND_VM_C_GOTO(isset_no_object); + result = (opline->extended_value & ZEND_ISEMPTY); + ZEND_VM_C_GOTO(isset_object_finish); } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -ZEND_VM_C_LABEL(isset_no_object): - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((OP2_TYPE == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +ZEND_VM_C_LABEL(isset_object_finish): FREE_OP2(); FREE_OP1(); ZEND_VM_SMART_BRANCH(result, 1); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 03d767247b..69e15a9fd9 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -4652,7 +4652,9 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_ if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -4704,21 +4706,17 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_ GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -4750,7 +4748,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -4800,19 +4799,15 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -5039,13 +5034,6 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_ } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - - - HANDLE_EXCEPTION(); - } - if (IS_CONST == IS_CONST) { function_name = RT_CONSTANT(opline, opline->op2); } @@ -5723,21 +5711,20 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PRO if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: ZEND_VM_SMART_BRANCH(result, 1); @@ -6826,7 +6813,9 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_ if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -6878,21 +6867,16 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_ GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -6925,7 +6909,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -6975,19 +6960,14 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -7215,13 +7195,6 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_ } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - zval_ptr_dtor_nogc(free_op2); - - HANDLE_EXCEPTION(); - } - if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { function_name = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC); } @@ -7699,22 +7672,20 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PRO if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_SMART_BRANCH(result, 1); @@ -9924,7 +9895,9 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_ if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -9976,21 +9949,17 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_ GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -10022,7 +9991,8 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -10072,19 +10042,15 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -10311,13 +10277,6 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_ } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - - - HANDLE_EXCEPTION(); - } - if (IS_CV == IS_CONST) { function_name = EX_VAR(opline->op2.var); } @@ -10794,21 +10753,20 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PRO if ((IS_CONST & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: ZEND_VM_SMART_BRANCH(result, 1); @@ -13669,7 +13627,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST_ if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -13721,21 +13681,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CONST_ GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: + zval_ptr_dtor_nogc(free_op1); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -13767,7 +13723,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -13817,19 +13774,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CONST } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: + zval_ptr_dtor_nogc(free_op1); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -14029,13 +13982,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - - zval_ptr_dtor_nogc(free_op1); - HANDLE_EXCEPTION(); - } - if (IS_CONST == IS_CONST) { function_name = RT_CONSTANT(opline, opline->op2); } @@ -14373,21 +14319,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TM if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: zval_ptr_dtor_nogc(free_op1); ZEND_VM_SMART_BRANCH(result, 1); @@ -15277,7 +15222,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -15329,21 +15276,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_TMPVAR GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: zval_ptr_dtor_nogc(free_op2); zval_ptr_dtor_nogc(free_op1); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -15376,7 +15318,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVA break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -15426,19 +15369,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_TMPVA } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: zval_ptr_dtor_nogc(free_op2); zval_ptr_dtor_nogc(free_op1); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -15639,13 +15577,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_T } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - zval_ptr_dtor_nogc(free_op2); - zval_ptr_dtor_nogc(free_op1); - HANDLE_EXCEPTION(); - } - if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { function_name = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC); } @@ -15852,22 +15783,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TM if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: zval_ptr_dtor_nogc(free_op2); zval_ptr_dtor_nogc(free_op1); ZEND_VM_SMART_BRANCH(result, 1); @@ -17156,7 +17085,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV_HAN if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -17208,21 +17139,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_TMPVAR_CV_HAN GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: + zval_ptr_dtor_nogc(free_op1); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -17254,7 +17181,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV_HA break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -17304,19 +17232,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_TMPVAR_CV_HA } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: + zval_ptr_dtor_nogc(free_op1); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -17516,13 +17440,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - - zval_ptr_dtor_nogc(free_op1); - HANDLE_EXCEPTION(); - } - if (IS_CV == IS_CONST) { function_name = EX_VAR(opline->op2.var); } @@ -17729,21 +17646,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_TM if (((IS_TMP_VAR|IS_VAR) & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: zval_ptr_dtor_nogc(free_op1); ZEND_VM_SMART_BRANCH(result, 1); @@ -21909,8 +21825,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -22335,8 +22250,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -22412,8 +22326,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -22722,12 +22635,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -22843,12 +22750,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -22964,12 +22865,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -23085,12 +22980,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -24008,14 +23897,10 @@ num_index_dim: offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); } if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { - if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_use_object_as_array(); - } else { - if (IS_CONST == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { - offset++; - } - Z_OBJ_HT_P(container)->unset_dimension(container, offset); + if (IS_CONST == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; } + Z_OBJ_HT_P(container)->unset_dimension(container, offset); } else if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_throw_error(NULL, "Cannot unset string offsets"); } @@ -24050,11 +23935,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CONST_HANDL break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; @@ -24274,8 +24155,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -24702,8 +24582,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -24780,8 +24659,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -25092,12 +24970,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -25213,12 +25085,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -25334,12 +25200,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -25455,12 +25315,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -26251,14 +26105,10 @@ num_index_dim: offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); } if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { - if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_use_object_as_array(); - } else { - if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { - offset++; - } - Z_OBJ_HT_P(container)->unset_dimension(container, offset); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; } + Z_OBJ_HT_P(container)->unset_dimension(container, offset); } else if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_throw_error(NULL, "Cannot unset string offsets"); } @@ -26294,11 +26144,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_TMPVAR_HAND break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); zval_ptr_dtor_nogc(free_op2); @@ -28172,8 +28018,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -28598,8 +28443,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -28675,8 +28519,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -28985,12 +28828,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -29106,12 +28943,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -29227,12 +29058,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -29348,12 +29173,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -30248,14 +30067,10 @@ num_index_dim: offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); } if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { - if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_use_object_as_array(); - } else { - if (IS_CV == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { - offset++; - } - Z_OBJ_HT_P(container)->unset_dimension(container, offset); + if (IS_CV == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; } + Z_OBJ_HT_P(container)->unset_dimension(container, offset); } else if (IS_VAR != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_throw_error(NULL, "Cannot unset string offsets"); } @@ -30290,11 +30105,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_VAR_CV_HANDLER( break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); if (UNEXPECTED(free_op1)) {zval_ptr_dtor_nogc(free_op1);}; @@ -30756,8 +30567,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -30897,8 +30707,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -30974,8 +30783,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -31048,7 +30856,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_U if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -31100,21 +30910,17 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_U GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -31191,7 +30997,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -31241,19 +31048,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CONST } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -31393,12 +31196,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -31514,12 +31311,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -31635,12 +31426,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -31756,12 +31541,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -31942,13 +31721,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_S } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - - - HANDLE_EXCEPTION(); - } - if (IS_CONST == IS_CONST) { function_name = RT_CONSTANT(opline, opline->op2); } @@ -32255,11 +32027,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CONST_HA break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); @@ -32288,21 +32056,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UN if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: ZEND_VM_SMART_BRANCH(result, 1); @@ -32482,8 +32249,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -32623,8 +32389,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -32701,8 +32466,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -32776,7 +32540,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -32828,21 +32594,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_TMPVAR GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -32920,7 +32681,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVA break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -32970,19 +32732,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_TMPVA } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -33123,12 +32880,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -33244,12 +32995,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -33365,12 +33110,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -33486,12 +33225,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -33673,13 +33406,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_T } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - zval_ptr_dtor_nogc(free_op2); - - HANDLE_EXCEPTION(); - } - if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { function_name = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC); } @@ -33899,11 +33625,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_TMPVAR_H break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); zval_ptr_dtor_nogc(free_op2); @@ -33933,22 +33655,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UN if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_SMART_BRANCH(result, 1); @@ -34862,8 +34582,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -35003,8 +34722,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -35080,8 +34798,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -35154,7 +34871,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HAN if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -35206,21 +34925,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_UNUSED_CV_HAN GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -35297,7 +35012,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HA break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -35347,19 +35063,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_UNUSED_CV_HA } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -35499,12 +35211,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -35620,12 +35326,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -35741,12 +35441,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -35862,12 +35556,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -36048,13 +35736,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - - - HANDLE_EXCEPTION(); - } - if (IS_CV == IS_CONST) { function_name = EX_VAR(opline->op2.var); } @@ -36274,11 +35955,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_UNUSED_CV_HANDL break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); @@ -36307,21 +35984,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_UN if ((IS_UNUSED & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: ZEND_VM_SMART_BRANCH(result, 1); @@ -38812,8 +38488,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -39238,8 +38913,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -39315,8 +38989,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -39631,7 +39304,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_C if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -39683,21 +39358,17 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_C GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -39774,7 +39445,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HAN break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -39824,19 +39496,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CONST_HAN } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -39976,12 +39644,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -40097,12 +39759,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -40218,12 +39874,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -40339,12 +39989,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -41055,13 +40699,6 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_S } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - - - HANDLE_EXCEPTION(); - } - if (IS_CONST == IS_CONST) { function_name = RT_CONSTANT(opline, opline->op2); } @@ -41363,14 +41000,10 @@ num_index_dim: offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); } if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { - if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_use_object_as_array(); - } else { - if (IS_CONST == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { - offset++; - } - Z_OBJ_HT_P(container)->unset_dimension(container, offset); + if (IS_CONST == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; } + Z_OBJ_HT_P(container)->unset_dimension(container, offset); } else if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_throw_error(NULL, "Cannot unset string offsets"); } @@ -41405,11 +41038,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CONST_HANDLE break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); @@ -41586,21 +41215,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CONST == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: ZEND_VM_SMART_BRANCH(result, 1); @@ -42701,8 +42329,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -43129,8 +42756,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -43207,8 +42833,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -43399,7 +43024,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HAN if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -43451,21 +43078,16 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_TMPVAR_HAN GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -43543,7 +43165,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR_HA break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -43593,19 +43216,14 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_TMPVAR_HA } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); @@ -43746,12 +43364,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -43867,12 +43479,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -43988,12 +43594,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -44109,12 +43709,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -44769,13 +44363,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVA } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - zval_ptr_dtor_nogc(free_op2); - - HANDLE_EXCEPTION(); - } - if ((IS_TMP_VAR|IS_VAR) == IS_CONST) { function_name = _get_zval_ptr_var(opline->op2.var, &free_op2 EXECUTE_DATA_CC); } @@ -45023,14 +44610,10 @@ num_index_dim: offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); } if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { - if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_use_object_as_array(); - } else { - if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { - offset++; - } - Z_OBJ_HT_P(container)->unset_dimension(container, offset); + if ((IS_TMP_VAR|IS_VAR) == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; } + Z_OBJ_HT_P(container)->unset_dimension(container, offset); } else if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_throw_error(NULL, "Cannot unset string offsets"); } @@ -45066,11 +44649,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_TMPVAR_HANDL break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); zval_ptr_dtor_nogc(free_op2); @@ -45172,22 +44751,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: zval_ptr_dtor_nogc(free_op2); ZEND_VM_SMART_BRANCH(result, 1); @@ -48450,8 +48027,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_binary_assign_op_obj_helper_SP /* here we are sure we are dealing with an object */ assign_op_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR((opline+1)->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -48876,8 +48452,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_pre_incdec_property_helper_SPE /* here we are sure we are dealing with an object */ pre_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { if (UNEXPECTED(RETURN_VALUE_USED(opline))) { ZVAL_NULL(EX_VAR(opline->result.var)); @@ -48953,8 +48528,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_post_incdec_property_helper_SP /* here we are sure we are dealing with an object */ post_incdec_object: - if (EXPECTED(Z_OBJ_HT_P(object)->get_property_ptr_ptr) - && EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { + if (EXPECTED((zptr = Z_OBJ_HT_P(object)->get_property_ptr_ptr(object, property, BP_VAR_RW, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL))) != NULL)) { if (UNEXPECTED(Z_ISERROR_P(zptr))) { ZVAL_NULL(EX_VAR(opline->result.var)); } else { @@ -49144,7 +48718,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(offset) == IS_UNDEF)) { GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - goto fetch_obj_r_no_object; + zend_wrong_property_read(offset); + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_r_finish; } while (0); } @@ -49196,21 +48772,17 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_R_SPEC_CV_CV_HANDLER GET_OP2_UNDEF_CV(offset, BP_VAR_R); } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_r_no_object: - zend_wrong_property_read(offset); - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_R, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); - } else if (UNEXPECTED(Z_ISREF_P(retval))) { - zend_unwrap_reference(retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY_DEREF(EX_VAR(opline->result.var), retval); + } else if (UNEXPECTED(Z_ISREF_P(retval))) { + zend_unwrap_reference(retval); } } while (0); +fetch_obj_r_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -49287,7 +48859,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLE break; } } - goto fetch_obj_is_no_object; + ZVAL_NULL(EX_VAR(opline->result.var)); + goto fetch_obj_is_finish; } while (0); } @@ -49337,19 +48910,15 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_OBJ_IS_SPEC_CV_CV_HANDLE } } - if (UNEXPECTED(zobj->handlers->read_property == NULL)) { -fetch_obj_is_no_object: - ZVAL_NULL(EX_VAR(opline->result.var)); - } else { - - retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); + retval = zobj->handlers->read_property(container, offset, BP_VAR_IS, cache_slot, EX_VAR(opline->result.var)); - if (retval != EX_VAR(opline->result.var)) { - ZVAL_COPY(EX_VAR(opline->result.var), retval); - } + if (retval != EX_VAR(opline->result.var)) { + ZVAL_COPY(EX_VAR(opline->result.var), retval); } } while (0); +fetch_obj_is_finish: + ZEND_VM_NEXT_OPCODE_CHECK_EXCEPTION(); } @@ -49489,12 +49058,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CONST == IS_CV || IS_CONST == IS_VAR) { ZVAL_DEREF(value); } @@ -49610,12 +49173,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_TMP_VAR == IS_CV || IS_TMP_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -49731,12 +49288,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - zval_ptr_dtor_nogc(free_op_data); - goto exit_assign_obj; - } - if (IS_VAR == IS_CV || IS_VAR == IS_VAR) { ZVAL_DEREF(value); } @@ -49852,12 +49403,6 @@ fast_assign_obj: } } - if (!Z_OBJ_HT_P(object)->write_property) { - zend_wrong_property_assignment(property OPLINE_CC EXECUTE_DATA_CC); - - goto exit_assign_obj; - } - if (IS_CV == IS_CV || IS_CV == IS_VAR) { ZVAL_DEREF(value); } @@ -50616,13 +50161,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HA } else { zend_object *orig_obj = obj; - if (UNEXPECTED(obj->handlers->get_method == NULL)) { - zend_throw_error(NULL, "Object does not support method calls"); - - - HANDLE_EXCEPTION(); - } - if (IS_CV == IS_CONST) { function_name = EX_VAR(opline->op2.var); } @@ -50870,14 +50408,10 @@ num_index_dim: offset = GET_OP2_UNDEF_CV(offset, BP_VAR_R); } if (EXPECTED(Z_TYPE_P(container) == IS_OBJECT)) { - if (UNEXPECTED(Z_OBJ_HT_P(container)->unset_dimension == NULL)) { - zend_use_object_as_array(); - } else { - if (IS_CV == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { - offset++; - } - Z_OBJ_HT_P(container)->unset_dimension(container, offset); + if (IS_CV == IS_CONST && Z_EXTRA_P(offset) == ZEND_EXTRA_VALUE) { + offset++; } + Z_OBJ_HT_P(container)->unset_dimension(container, offset); } else if (IS_CV != IS_UNUSED && UNEXPECTED(Z_TYPE_P(container) == IS_STRING)) { zend_throw_error(NULL, "Cannot unset string offsets"); } @@ -50912,11 +50446,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_UNSET_OBJ_SPEC_CV_CV_HANDLER(Z break; } } - if (Z_OBJ_HT_P(container)->unset_property) { - Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); - } else { - zend_wrong_property_unset(offset); - } + Z_OBJ_HT_P(container)->unset_property(container, offset, ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value) : NULL)); } while (0); @@ -51017,21 +50547,20 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_PROP_OBJ_SPEC_CV if ((IS_CV & (IS_VAR|IS_CV)) && Z_ISREF_P(container)) { container = Z_REFVAL_P(container); if (UNEXPECTED(Z_TYPE_P(container) != IS_OBJECT)) { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } else { - goto isset_no_object; + result = (opline->extended_value & ZEND_ISEMPTY); + goto isset_object_finish; } } - if (UNEXPECTED(!Z_OBJ_HT_P(container)->has_property)) { - zend_wrong_property_check(offset); -isset_no_object: - result = (opline->extended_value & ZEND_ISEMPTY); - } else { - result = - (opline->extended_value & ZEND_ISEMPTY) ^ - Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); - } + + result = + (opline->extended_value & ZEND_ISEMPTY) ^ + Z_OBJ_HT_P(container)->has_property(container, offset, (opline->extended_value & ZEND_ISEMPTY), ((IS_CV == IS_CONST) ? CACHE_ADDR(opline->extended_value & ~ZEND_ISEMPTY) : NULL)); + +isset_object_finish: ZEND_VM_SMART_BRANCH(result, 1); diff --git a/ext/com_dotnet/com_handlers.c b/ext/com_dotnet/com_handlers.c index 8424c3acfc..13e31f945a 100644 --- a/ext/com_dotnet/com_handlers.c +++ b/ext/com_dotnet/com_handlers.c @@ -562,7 +562,7 @@ zend_object_handlers php_com_object_handlers = { com_object_count, NULL, /* get_debug_info */ NULL, /* get_closure */ - NULL, /* get_gc */ + zend_std_get_gc, /* get_gc */ }; void php_com_object_enable_event_sink(php_com_dotnet_object *obj, int enable) diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 8114625e68..59ff6526a7 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -4173,7 +4173,7 @@ ZEND_METHOD(reflection_class, hasProperty) } RETURN_TRUE; } else { - if (Z_TYPE(intern->obj) != IS_UNDEF && Z_OBJ_HANDLER(intern->obj, has_property)) { + if (Z_TYPE(intern->obj) != IS_UNDEF) { ZVAL_STR_COPY(&property, name); if (Z_OBJ_HANDLER(intern->obj, has_property)(&intern->obj, &property, 2, NULL)) { zval_ptr_dtor(&property); diff --git a/ext/spl/spl_iterators.c b/ext/spl/spl_iterators.c index f1688dbf16..40fa9f3f06 100644 --- a/ext/spl/spl_iterators.c +++ b/ext/spl/spl_iterators.c @@ -897,10 +897,8 @@ static zend_function *spl_recursive_it_get_method(zend_object **zobject, zend_st function_handler = zend_std_get_method(zobject, method, key); if (!function_handler) { if ((function_handler = zend_hash_find_ptr(&Z_OBJCE_P(zobj)->function_table, method)) == NULL) { - if (Z_OBJ_HT_P(zobj)->get_method) { - *zobject = Z_OBJ_P(zobj); - function_handler = (*zobject)->handlers->get_method(zobject, method, key); - } + *zobject = Z_OBJ_P(zobj); + function_handler = (*zobject)->handlers->get_method(zobject, method, key); } else { *zobject = Z_OBJ_P(zobj); } diff --git a/ext/standard/array.c b/ext/standard/array.c index 4d94c54ff1..4e2916a7eb 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -4097,10 +4097,6 @@ static inline zval *array_column_fetch_prop(zval *data, zval *name, zval *rv) /* zval *prop = NULL; if (Z_TYPE_P(data) == IS_OBJECT) { - if (!Z_OBJ_HANDLER_P(data, has_property) || !Z_OBJ_HANDLER_P(data, read_property)) { - return NULL; - } - /* The has_property check is first performed in "exists" mode (which returns true for * properties that are null but exist) and then in "has" mode to handle objects that * implement __isset (which is not called in "exists" mode). */ |