Lines Matching refs:zobj
66 ZEND_API HashTable *rebuild_object_properties_internal(zend_object *zobj) /* {{{ */ in rebuild_object_properties_internal() argument
68 if (!zobj->properties) { in rebuild_object_properties_internal()
70 zend_class_entry *ce = zobj->ce; in rebuild_object_properties_internal()
73 zobj->properties = zend_new_array(ce->default_properties_count); in rebuild_object_properties_internal()
75 zend_hash_real_init_mixed(zobj->properties); in rebuild_object_properties_internal()
83 if (UNEXPECTED(Z_TYPE_P(OBJ_PROP(zobj, prop_info->offset)) == IS_UNDEF)) { in rebuild_object_properties_internal()
84 HT_FLAGS(zobj->properties) |= HASH_FLAG_HAS_EMPTY_IND; in rebuild_object_properties_internal()
87 _zend_hash_append_ind(zobj->properties, prop_info->name, in rebuild_object_properties_internal()
88 OBJ_PROP(zobj, prop_info->offset)); in rebuild_object_properties_internal()
93 return zobj->properties; in rebuild_object_properties_internal()
98 ZEND_API HashTable *zend_std_build_object_properties_array(zend_object *zobj) /* {{{ */ in zend_std_build_object_properties_array() argument
101 zend_class_entry *ce = zobj->ce; in zend_std_build_object_properties_array()
106 ZEND_ASSERT(!(zend_object_is_lazy_proxy(zobj) && zend_lazy_object_initialized(zobj))); in zend_std_build_object_properties_array()
107 ZEND_ASSERT(!zobj->properties); in zend_std_build_object_properties_array()
118 prop = OBJ_PROP(zobj, prop_info->offset); in zend_std_build_object_properties_array()
135 ZEND_API HashTable *zend_std_get_properties(zend_object *zobj) /* {{{ */ in zend_std_get_properties() argument
137 return zend_std_get_properties_ex(zobj); in zend_std_get_properties()
142 ZEND_API HashTable *zend_get_properties_no_lazy_init(zend_object *zobj) in zend_get_properties_no_lazy_init() argument
144 if (zobj->handlers->get_properties == zend_std_get_properties) { in zend_get_properties_no_lazy_init()
145 if (UNEXPECTED(zend_object_is_lazy_proxy(zobj) in zend_get_properties_no_lazy_init()
146 && zend_lazy_object_initialized(zobj))) { in zend_get_properties_no_lazy_init()
147 zend_object *instance = zend_lazy_object_get_instance(zobj); in zend_get_properties_no_lazy_init()
151 if (!zobj->properties) { in zend_get_properties_no_lazy_init()
152 rebuild_object_properties_internal(zobj); in zend_get_properties_no_lazy_init()
154 return zobj->properties; in zend_get_properties_no_lazy_init()
157 ZEND_ASSERT(!zend_object_is_lazy(zobj)); in zend_get_properties_no_lazy_init()
159 return zobj->handlers->get_properties(zobj); in zend_get_properties_no_lazy_init()
162 ZEND_API HashTable *zend_std_get_gc(zend_object *zobj, zval **table, int *n) /* {{{ */ in zend_std_get_gc() argument
164 if (zobj->handlers->get_properties != zend_std_get_properties) { in zend_std_get_gc()
167 return zobj->handlers->get_properties(zobj); in zend_std_get_gc()
169 if (UNEXPECTED(zend_object_is_lazy(zobj))) { in zend_std_get_gc()
170 return zend_lazy_object_get_gc(zobj, table, n); in zend_std_get_gc()
171 } else if (zobj->properties) { in zend_std_get_gc()
174 return zobj->properties; in zend_std_get_gc()
176 *table = zobj->properties_table; in zend_std_get_gc()
177 *n = zobj->ce->default_properties_count; in zend_std_get_gc()
225 static void zend_std_call_getter(zend_object *zobj, zend_string *prop_name, zval *retval) /* {{{ */ in zend_std_call_getter() argument
229 zend_call_known_instance_method_with_1_params(zobj->ce->__get, zobj, retval, &member); in zend_std_call_getter()
233 static void zend_std_call_setter(zend_object *zobj, zend_string *prop_name, zval *value) /* {{{ */ in zend_std_call_setter() argument
238 zend_call_known_instance_method(zobj->ce->__set, zobj, NULL, 2, args); in zend_std_call_setter()
242 static void zend_std_call_unsetter(zend_object *zobj, zend_string *prop_name) /* {{{ */ in zend_std_call_unsetter() argument
246 zend_call_known_instance_method_with_1_params(zobj->ce->__unset, zobj, NULL, &member); in zend_std_call_unsetter()
250 static void zend_std_call_issetter(zend_object *zobj, zend_string *prop_name, zval *retval) /* {{{ … in zend_std_call_issetter() argument
254 zend_call_known_instance_method_with_1_params(zobj->ce->__isset, zobj, retval, &member); in zend_std_call_issetter()
525 ZEND_API zend_result zend_check_property_access(const zend_object *zobj, zend_string *prop_info_nam… in zend_check_property_access() argument
540 property_info = zend_get_property_info(zobj->ce, member, 1); in zend_check_property_access()
559 property_info = zend_get_property_info(zobj->ce, prop_info_name, 1); in zend_check_property_access()
590 static zend_always_inline zval *zend_get_guard_value(zend_object *zobj) in zend_get_guard_value() argument
592 return zobj->properties_table + zobj->ce->default_properties_count; in zend_get_guard_value()
595 ZEND_API uint32_t *zend_get_property_guard(zend_object *zobj, zend_string *member) /* {{{ */ in zend_get_property_guard() argument
602 ZEND_ASSERT(zobj->ce->ce_flags & ZEND_ACC_USE_GUARDS); in zend_get_property_guard()
603 zv = zend_get_guard_value(zobj); in zend_get_property_guard()
643 ZEND_API uint32_t *zend_get_recursion_guard(zend_object *zobj) in zend_get_recursion_guard() argument
645 if (!(zobj->ce->ce_flags & ZEND_ACC_USE_GUARDS)) { in zend_get_recursion_guard()
648 zval *zv = zend_get_guard_value(zobj); in zend_get_recursion_guard()
690 zend_function *get, zend_object *zobj, zval *rv) in zend_call_get_hook() argument
692 if (!zend_should_call_hook(prop_info, zobj)) { in zend_call_get_hook()
694 zend_throw_no_prop_backing_value_access(zobj->ce->name, prop_name, /* is_read */ true); in zend_call_get_hook()
699 zend_call_known_instance_method_with_0_params(get, zobj, rv); in zend_call_get_hook()
704 ZEND_API zval *zend_std_read_property(zend_object *zobj, zend_string *name, int type, void **cache_… in zend_std_read_property() argument
712 fprintf(stderr, "Read object #%d property: %s\n", zobj->handle, ZSTR_VAL(name)); in zend_std_read_property()
716 …property_offset = zend_get_property_offset(zobj->ce, name, (type == BP_VAR_IS) || (zobj->ce->__get… in zend_std_read_property()
720 retval = OBJ_PROP(zobj, property_offset); in zend_std_read_property()
752 if (EXPECTED(zobj->properties != NULL)) { in zend_std_read_property()
756 if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { in zend_std_read_property()
757 Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); in zend_std_read_property()
769 retval = zend_hash_find(zobj->properties, name); in zend_std_read_property()
772 uintptr_t idx = (char*)retval - (char*)zobj->properties->arData; in zend_std_read_property()
783 ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name)); in zend_std_read_property()
790 retval = OBJ_PROP(zobj, prop_info->offset); in zend_std_read_property()
801 ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name)); in zend_std_read_property()
810 zend_class_entry *ce = zobj->ce; in zend_std_read_property()
812 if (!zend_call_get_hook(prop_info, name, get, zobj, rv)) { in zend_std_read_property()
860 if ((type == BP_VAR_IS) && zobj->ce->__isset) { in zend_std_read_property()
862 guard = zend_get_property_guard(zobj, name); in zend_std_read_property()
865 GC_ADDREF(zobj); in zend_std_read_property()
869 zend_std_call_issetter(zobj, name, &tmp_result); in zend_std_read_property()
874 OBJ_RELEASE(zobj); in zend_std_read_property()
880 if (zobj->ce->__get && !((*guard) & IN_GET)) { in zend_std_read_property()
883 OBJ_RELEASE(zobj); in zend_std_read_property()
884 } else if (zobj->ce->__get && !((*guard) & IN_GET)) { in zend_std_read_property()
887 } else if (zobj->ce->__get) { in zend_std_read_property()
889 guard = zend_get_property_guard(zobj, name); in zend_std_read_property()
893 GC_ADDREF(zobj); in zend_std_read_property()
896 zend_std_call_getter(zobj, name, rv); in zend_std_read_property()
904 …rect modification of overloaded property %s::$%s has no effect", ZSTR_VAL(zobj->ce->name), ZSTR_VA… in zend_std_read_property()
912 …zend_verify_prop_assignable_by_ref_ex(prop_info, retval, (zobj->ce->__get->common.fn_flags & ZEND_… in zend_std_read_property()
915 OBJ_RELEASE(zobj); in zend_std_read_property()
919 zend_wrong_offset(zobj->ce, name); in zend_std_read_property()
927 if (UNEXPECTED(zend_lazy_object_must_init(zobj))) { in zend_std_read_property()
929 zobj = zend_lazy_object_init(zobj); in zend_std_read_property()
930 if (!zobj) { in zend_std_read_property()
935 return zend_std_read_property(zobj, name, type, cache_slot, rv); in zend_std_read_property()
942 zend_error(E_WARNING, "Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name)); in zend_std_read_property()
959 ZEND_API zval *zend_std_write_property(zend_object *zobj, zend_string *name, zval *value, void **ca… in zend_std_write_property() argument
967 …property_offset = zend_get_property_offset(zobj->ce, name, (zobj->ce->__set != NULL), cache_slot, … in zend_std_write_property()
971 variable_ptr = OBJ_PROP(zobj, property_offset); in zend_std_write_property()
975 …(variable_ptr) != IS_UNDEF || (Z_PROP_FLAG_P(variable_ptr) & IS_PROP_UNINIT) || !zobj->ce->__set) { in zend_std_write_property()
978 guard = zend_get_property_guard(zobj, name); in zend_std_write_property()
1004 GC_ADDREF(zobj); in zend_std_write_property()
1006 if (UNEXPECTED(GC_DELREF(zobj) == 0)) { in zend_std_write_property()
1008 zend_objects_store_del(zobj); in zend_std_write_property()
1049 if (UNEXPECTED(zend_lazy_object_must_init(zobj))) { in zend_std_write_property()
1058 if (EXPECTED(zobj->properties != NULL)) { in zend_std_write_property()
1059 if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { in zend_std_write_property()
1060 if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { in zend_std_write_property()
1061 GC_DELREF(zobj->properties); in zend_std_write_property()
1063 zobj->properties = zend_array_dup(zobj->properties); in zend_std_write_property()
1065 if ((variable_ptr = zend_hash_find(zobj->properties, name)) != NULL) { in zend_std_write_property()
1075 … zend_throw_error(NULL, "Property %s::$%s is read-only", ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name)); in zend_std_write_property()
1087 if (!zend_should_call_hook(prop_info, zobj)) { in zend_std_write_property()
1089 zend_throw_no_prop_backing_value_access(zobj->ce->name, name, /* is_read */ false); in zend_std_write_property()
1114 GC_ADDREF(zobj); in zend_std_write_property()
1115 zend_call_known_instance_method_with_1_params(set, zobj, NULL, value); in zend_std_write_property()
1116 OBJ_RELEASE(zobj); in zend_std_write_property()
1126 if (zobj->ce->__set) { in zend_std_write_property()
1128 guard = zend_get_property_guard(zobj, name); in zend_std_write_property()
1132 GC_ADDREF(zobj); in zend_std_write_property()
1134 zend_std_call_setter(zobj, name, value); in zend_std_write_property()
1136 OBJ_RELEASE(zobj); in zend_std_write_property()
1139 if (UNEXPECTED(zend_lazy_object_must_init(zobj))) { in zend_std_write_property()
1146 zend_wrong_offset(zobj->ce, name); in zend_std_write_property()
1153 if (UNEXPECTED(zend_lazy_object_must_init(zobj))) { in zend_std_write_property()
1158 variable_ptr = OBJ_PROP(zobj, property_offset); in zend_std_write_property()
1167 if (UNEXPECTED(zobj->ce->ce_flags & ZEND_ACC_NO_DYNAMIC_PROPERTIES)) { in zend_std_write_property()
1168 zend_forbidden_dynamic_property(zobj->ce, name); in zend_std_write_property()
1172 if (UNEXPECTED(!(zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES))) { in zend_std_write_property()
1173 if (UNEXPECTED(!zend_deprecated_dynamic_property(zobj, name))) { in zend_std_write_property()
1180 variable_ptr = zend_hash_add_new(zend_std_get_properties(zobj), name, value); in zend_std_write_property()
1192 zobj = zend_lazy_object_init(zobj); in zend_std_write_property()
1193 if (UNEXPECTED(!zobj)) { in zend_std_write_property()
1199 variable_ptr = zend_std_write_property(zobj, name, &backup, cache_slot); in zend_std_write_property()
1314 ZEND_API zval *zend_std_get_property_ptr_ptr(zend_object *zobj, zend_string *name, int type, void *… in zend_std_get_property_ptr_ptr() argument
1321 fprintf(stderr, "Ptr object #%d property: %s\n", zobj->handle, ZSTR_VAL(name)); in zend_std_get_property_ptr_ptr()
1324 …property_offset = zend_get_property_offset(zobj->ce, name, (zobj->ce->__get != NULL), cache_slot, … in zend_std_get_property_ptr_ptr()
1327 retval = OBJ_PROP(zobj, property_offset); in zend_std_get_property_ptr_ptr()
1329 if (EXPECTED(!zobj->ce->__get) || in zend_std_get_property_ptr_ptr()
1330 UNEXPECTED((*zend_get_property_guard(zobj, name)) & IN_GET) || in zend_std_get_property_ptr_ptr()
1332 if (UNEXPECTED(zend_lazy_object_must_init(zobj) && (Z_PROP_FLAG_P(retval) & IS_PROP_LAZY))) { in zend_std_get_property_ptr_ptr()
1333 zobj = zend_lazy_object_init(zobj); in zend_std_get_property_ptr_ptr()
1334 if (!zobj) { in zend_std_get_property_ptr_ptr()
1338 return zend_std_get_property_ptr_ptr(zobj, name, type, cache_slot); in zend_std_get_property_ptr_ptr()
1345 … zend_error(E_WARNING, "Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name)); in zend_std_get_property_ptr_ptr()
1368 if (EXPECTED(zobj->properties)) { in zend_std_get_property_ptr_ptr()
1369 if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { in zend_std_get_property_ptr_ptr()
1370 if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { in zend_std_get_property_ptr_ptr()
1371 GC_DELREF(zobj->properties); in zend_std_get_property_ptr_ptr()
1373 zobj->properties = zend_array_dup(zobj->properties); in zend_std_get_property_ptr_ptr()
1375 if (EXPECTED((retval = zend_hash_find(zobj->properties, name)) != NULL)) { in zend_std_get_property_ptr_ptr()
1379 if (EXPECTED(!zobj->ce->__get) || in zend_std_get_property_ptr_ptr()
1380 UNEXPECTED((*zend_get_property_guard(zobj, name)) & IN_GET)) { in zend_std_get_property_ptr_ptr()
1381 if (UNEXPECTED(zobj->ce->ce_flags & ZEND_ACC_NO_DYNAMIC_PROPERTIES)) { in zend_std_get_property_ptr_ptr()
1382 zend_forbidden_dynamic_property(zobj->ce, name); in zend_std_get_property_ptr_ptr()
1385 if (UNEXPECTED(!(zobj->ce->ce_flags & ZEND_ACC_ALLOW_DYNAMIC_PROPERTIES))) { in zend_std_get_property_ptr_ptr()
1386 if (UNEXPECTED(!zend_deprecated_dynamic_property(zobj, name))) { in zend_std_get_property_ptr_ptr()
1390 if (UNEXPECTED(zend_lazy_object_must_init(zobj))) { in zend_std_get_property_ptr_ptr()
1391 zobj = zend_lazy_object_init(zobj); in zend_std_get_property_ptr_ptr()
1392 if (!zobj) { in zend_std_get_property_ptr_ptr()
1396 return zend_std_get_property_ptr_ptr(zobj, name, type, cache_slot); in zend_std_get_property_ptr_ptr()
1398 if (UNEXPECTED(!zobj->properties)) { in zend_std_get_property_ptr_ptr()
1399 rebuild_object_properties_internal(zobj); in zend_std_get_property_ptr_ptr()
1402 zend_error(E_WARNING, "Undefined property: %s::$%s", ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name)); in zend_std_get_property_ptr_ptr()
1404 retval = zend_hash_add(zobj->properties, name, &EG(uninitialized_zval)); in zend_std_get_property_ptr_ptr()
1406 } else if (!IS_HOOKED_PROPERTY_OFFSET(property_offset) && zobj->ce->__get == NULL) { in zend_std_get_property_ptr_ptr()
1414 ZEND_API void zend_std_unset_property(zend_object *zobj, zend_string *name, void **cache_slot) /* {… in zend_std_unset_property() argument
1420 …property_offset = zend_get_property_offset(zobj->ce, name, (zobj->ce->__unset != NULL), cache_slot… in zend_std_unset_property()
1423 zval *slot = OBJ_PROP(zobj, property_offset); in zend_std_unset_property()
1427 if (Z_TYPE_P(slot) != IS_UNDEF || Z_PROP_FLAG_P(slot) & IS_PROP_UNINIT || !zobj->ce->__unset) { in zend_std_unset_property()
1430 guard = zend_get_property_guard(zobj, name); in zend_std_unset_property()
1458 if (zobj->properties) { in zend_std_unset_property()
1459 HT_FLAGS(zobj->properties) |= HASH_FLAG_HAS_EMPTY_IND; in zend_std_unset_property()
1464 if (UNEXPECTED(zend_lazy_object_must_init(zobj) && (Z_PROP_FLAG_P(slot) & IS_PROP_LAZY))) { in zend_std_unset_property()
1465 zobj = zend_lazy_object_init(zobj); in zend_std_unset_property()
1466 if (!zobj) { in zend_std_unset_property()
1469 zend_std_unset_property(zobj, name, cache_slot); in zend_std_unset_property()
1478 && EXPECTED(zobj->properties != NULL)) { in zend_std_unset_property()
1479 if (UNEXPECTED(GC_REFCOUNT(zobj->properties) > 1)) { in zend_std_unset_property()
1480 if (EXPECTED(!(GC_FLAGS(zobj->properties) & IS_ARRAY_IMMUTABLE))) { in zend_std_unset_property()
1481 GC_DELREF(zobj->properties); in zend_std_unset_property()
1483 zobj->properties = zend_array_dup(zobj->properties); in zend_std_unset_property()
1485 if (EXPECTED(zend_hash_del(zobj->properties, name) != FAILURE)) { in zend_std_unset_property()
1490 ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name)); in zend_std_unset_property()
1497 if (zobj->ce->__unset) { in zend_std_unset_property()
1499 guard = zend_get_property_guard(zobj, name); in zend_std_unset_property()
1504 zend_std_call_unsetter(zobj, name); in zend_std_unset_property()
1509 zend_wrong_offset(zobj->ce, name); in zend_std_unset_property()
1517 if (UNEXPECTED(zend_lazy_object_must_init(zobj))) { in zend_std_unset_property()
1518 zobj = zend_lazy_object_init(zobj); in zend_std_unset_property()
1519 if (!zobj) { in zend_std_unset_property()
1522 zend_std_unset_property(zobj, name, cache_slot); in zend_std_unset_property()
1764 zend_object *zobj = *obj_ptr; in zend_std_get_method() local
1781 if (UNEXPECTED((func = zend_hash_find(&zobj->ce->function_table, lc_method_name)) == NULL)) { in zend_std_get_method()
1785 if (zobj->ce->__call) { in zend_std_get_method()
1786 return zend_get_user_call_function(zobj->ce, method_name); in zend_std_get_method()
1800 zend_function *updated_fbc = zend_get_parent_private_method(scope, zobj->ce, lc_method_name); in zend_std_get_method()
1811 if (zobj->ce->__call) { in zend_std_get_method()
1812 fbc = zend_get_user_call_function(zobj->ce, method_name); in zend_std_get_method()
2024 ZEND_API zend_function *zend_std_get_constructor(zend_object *zobj) /* {{{ */ in zend_std_get_constructor() argument
2026 zend_function *constructor = zobj->ce->constructor; in zend_std_get_constructor()
2035 zend_object_store_ctor_failed(zobj); in zend_std_get_constructor()
2165 ZEND_API int zend_std_has_property(zend_object *zobj, zend_string *name, int has_set_exists, void *… in zend_std_has_property() argument
2172 property_offset = zend_get_property_offset(zobj->ce, name, 1, cache_slot, &prop_info); in zend_std_has_property()
2176 value = OBJ_PROP(zobj, property_offset); in zend_std_has_property()
2185 if (EXPECTED(zobj->properties != NULL)) { in zend_std_has_property()
2189 if (EXPECTED(idx < zobj->properties->nNumUsed * sizeof(Bucket))) { in zend_std_has_property()
2190 Bucket *p = (Bucket*)((char*)zobj->properties->arData + idx); in zend_std_has_property()
2202 value = zend_hash_find(zobj->properties, name); in zend_std_has_property()
2205 uintptr_t idx = (char*)value - (char*)zobj->properties->arData; in zend_std_has_property()
2236 ZSTR_VAL(zobj->ce->name), ZSTR_VAL(name)); in zend_std_has_property()
2245 if (!zend_call_get_hook(prop_info, name, get, zobj, &rv)) { in zend_std_has_property()
2267 if (!zobj->ce->__isset) { in zend_std_has_property()
2273 uint32_t *guard = zend_get_property_guard(zobj, name); in zend_std_has_property()
2279 GC_ADDREF(zobj); in zend_std_has_property()
2281 zend_std_call_issetter(zobj, name, &rv); in zend_std_has_property()
2285 if (EXPECTED(!EG(exception)) && zobj->ce->__get && !((*guard) & IN_GET)) { in zend_std_has_property()
2287 zend_std_call_getter(zobj, name, &rv); in zend_std_has_property()
2296 OBJ_RELEASE(zobj); in zend_std_has_property()
2304 if (UNEXPECTED(zend_lazy_object_must_init(zobj))) { in zend_std_has_property()
2306 zobj = zend_lazy_object_init(zobj); in zend_std_has_property()
2307 if (!zobj) { in zend_std_has_property()
2312 return zend_std_has_property(zobj, name, has_set_exists, cache_slot); in zend_std_has_property()
2321 ZEND_API zend_string *zend_std_get_class_name(const zend_object *zobj) /* {{{ */ in zend_std_get_class_name() argument
2323 return zend_string_copy(zobj->ce->name); in zend_std_get_class_name()
2430 zend_object *zobj = Z_OBJ_P(obj); in zend_get_properties_for() local
2432 if (zobj->handlers->get_properties_for) { in zend_get_properties_for()
2433 return zobj->handlers->get_properties_for(zobj, purpose); in zend_get_properties_for()
2436 return zend_std_get_properties_for(zobj, purpose); in zend_get_properties_for()