Lines Matching refs:ce
178 ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce) in zend_cleanup_internal_class_data() argument
180 if (ZEND_MAP_PTR(ce->static_members_table) && CE_STATIC_MEMBERS(ce)) { in zend_cleanup_internal_class_data()
181 zval *static_members = CE_STATIC_MEMBERS(ce); in zend_cleanup_internal_class_data()
183 zval *end = p + ce->default_static_members_count; in zend_cleanup_internal_class_data()
184 ZEND_MAP_PTR_SET(ce->static_members_table, NULL); in zend_cleanup_internal_class_data()
189 if (prop_info->ce == ce && p - static_members == prop_info->offset) { in zend_cleanup_internal_class_data()
202 static void _destroy_zend_class_traits_info(zend_class_entry *ce) in _destroy_zend_class_traits_info() argument
206 for (i = 0; i < ce->num_traits; i++) { in _destroy_zend_class_traits_info()
207 zend_string_release_ex(ce->trait_names[i].name, 0); in _destroy_zend_class_traits_info()
208 zend_string_release_ex(ce->trait_names[i].lc_name, 0); in _destroy_zend_class_traits_info()
210 efree(ce->trait_names); in _destroy_zend_class_traits_info()
212 if (ce->trait_aliases) { in _destroy_zend_class_traits_info()
214 while (ce->trait_aliases[i]) { in _destroy_zend_class_traits_info()
215 if (ce->trait_aliases[i]->trait_method.method_name) { in _destroy_zend_class_traits_info()
216 zend_string_release_ex(ce->trait_aliases[i]->trait_method.method_name, 0); in _destroy_zend_class_traits_info()
218 if (ce->trait_aliases[i]->trait_method.class_name) { in _destroy_zend_class_traits_info()
219 zend_string_release_ex(ce->trait_aliases[i]->trait_method.class_name, 0); in _destroy_zend_class_traits_info()
222 if (ce->trait_aliases[i]->alias) { in _destroy_zend_class_traits_info()
223 zend_string_release_ex(ce->trait_aliases[i]->alias, 0); in _destroy_zend_class_traits_info()
226 efree(ce->trait_aliases[i]); in _destroy_zend_class_traits_info()
230 efree(ce->trait_aliases); in _destroy_zend_class_traits_info()
233 if (ce->trait_precedences) { in _destroy_zend_class_traits_info()
237 while (ce->trait_precedences[i]) { in _destroy_zend_class_traits_info()
238 zend_string_release_ex(ce->trait_precedences[i]->trait_method.method_name, 0); in _destroy_zend_class_traits_info()
239 zend_string_release_ex(ce->trait_precedences[i]->trait_method.class_name, 0); in _destroy_zend_class_traits_info()
241 for (j = 0; j < ce->trait_precedences[i]->num_excludes; j++) { in _destroy_zend_class_traits_info()
242 zend_string_release_ex(ce->trait_precedences[i]->exclude_class_names[j], 0); in _destroy_zend_class_traits_info()
244 efree(ce->trait_precedences[i]); in _destroy_zend_class_traits_info()
247 efree(ce->trait_precedences); in _destroy_zend_class_traits_info()
251 ZEND_API void zend_cleanup_mutable_class_data(zend_class_entry *ce) in zend_cleanup_mutable_class_data() argument
253 zend_class_mutable_data *mutable_data = ZEND_MAP_PTR_GET_IMM(ce->mutable_data); in zend_cleanup_mutable_class_data()
260 if (constants_table && constants_table != &ce->constants_table) { in zend_cleanup_mutable_class_data()
264 if (c->ce == ce || (Z_CONSTANT_FLAGS(c->value) & CONST_OWNED)) { in zend_cleanup_mutable_class_data()
273 if (p && p != ce->default_properties_table) { in zend_cleanup_mutable_class_data()
274 zval *end = p + ce->default_properties_count; in zend_cleanup_mutable_class_data()
288 ZEND_MAP_PTR_SET_IMM(ce->mutable_data, NULL); in zend_cleanup_mutable_class_data()
295 zend_class_entry *ce = Z_PTR_P(zv); in destroy_zend_class() local
298 if (ce->ce_flags & ZEND_ACC_IMMUTABLE) { in destroy_zend_class()
308 if (ce->ce_flags & ZEND_ACC_FILE_CACHED) { in destroy_zend_class()
312 ZEND_HASH_MAP_FOREACH_PTR(&ce->constants_table, c) { in destroy_zend_class()
313 if (c->ce == ce) { in destroy_zend_class()
318 if (ce->default_properties_table) { in destroy_zend_class()
319 p = ce->default_properties_table; in destroy_zend_class()
320 end = p + ce->default_properties_count; in destroy_zend_class()
330 ZEND_ASSERT(ce->refcount > 0); in destroy_zend_class()
332 if (--ce->refcount > 0) { in destroy_zend_class()
336 switch (ce->type) { in destroy_zend_class()
338 if (!(ce->ce_flags & ZEND_ACC_CACHED)) { in destroy_zend_class()
339 if (ce->parent_name && !(ce->ce_flags & ZEND_ACC_RESOLVED_PARENT)) { in destroy_zend_class()
340 zend_string_release_ex(ce->parent_name, 0); in destroy_zend_class()
343 zend_string_release_ex(ce->name, 0); in destroy_zend_class()
344 zend_string_release_ex(ce->info.user.filename, 0); in destroy_zend_class()
346 if (ce->doc_comment) { in destroy_zend_class()
347 zend_string_release_ex(ce->doc_comment, 0); in destroy_zend_class()
350 if (ce->attributes) { in destroy_zend_class()
351 zend_hash_release(ce->attributes); in destroy_zend_class()
354 if (ce->num_interfaces > 0 && !(ce->ce_flags & ZEND_ACC_RESOLVED_INTERFACES)) { in destroy_zend_class()
357 for (i = 0; i < ce->num_interfaces; i++) { in destroy_zend_class()
358 zend_string_release_ex(ce->interface_names[i].name, 0); in destroy_zend_class()
359 zend_string_release_ex(ce->interface_names[i].lc_name, 0); in destroy_zend_class()
361 efree(ce->interface_names); in destroy_zend_class()
364 if (ce->num_traits > 0) { in destroy_zend_class()
365 _destroy_zend_class_traits_info(ce); in destroy_zend_class()
369 if (ce->default_properties_table) { in destroy_zend_class()
370 zval *p = ce->default_properties_table; in destroy_zend_class()
371 zval *end = p + ce->default_properties_count; in destroy_zend_class()
377 efree(ce->default_properties_table); in destroy_zend_class()
379 if (ce->default_static_members_table) { in destroy_zend_class()
380 zval *p = ce->default_static_members_table; in destroy_zend_class()
381 zval *end = p + ce->default_static_members_count; in destroy_zend_class()
388 efree(ce->default_static_members_table); in destroy_zend_class()
390 ZEND_HASH_MAP_FOREACH_PTR(&ce->properties_info, prop_info) { in destroy_zend_class()
391 if (prop_info->ce == ce) { in destroy_zend_class()
409 zend_hash_destroy(&ce->properties_info); in destroy_zend_class()
410 zend_hash_destroy(&ce->function_table); in destroy_zend_class()
411 if (zend_hash_num_elements(&ce->constants_table)) { in destroy_zend_class()
414 ZEND_HASH_MAP_FOREACH_PTR(&ce->constants_table, c) { in destroy_zend_class()
415 if (c->ce == ce || (Z_CONSTANT_FLAGS(c->value) & CONST_OWNED)) { in destroy_zend_class()
426 zend_hash_destroy(&ce->constants_table); in destroy_zend_class()
427 if (ce->num_interfaces > 0 && (ce->ce_flags & ZEND_ACC_RESOLVED_INTERFACES)) { in destroy_zend_class()
428 efree(ce->interfaces); in destroy_zend_class()
430 if (ce->backed_enum_table) { in destroy_zend_class()
431 zend_hash_release(ce->backed_enum_table); in destroy_zend_class()
435 if (ce->doc_comment) { in destroy_zend_class()
436 zend_string_release_ex(ce->doc_comment, 1); in destroy_zend_class()
439 if (ce->backed_enum_table) { in destroy_zend_class()
440 zend_hash_release(ce->backed_enum_table); in destroy_zend_class()
442 if (ce->default_properties_table) { in destroy_zend_class()
443 zval *p = ce->default_properties_table; in destroy_zend_class()
444 zval *end = p + ce->default_properties_count; in destroy_zend_class()
450 free(ce->default_properties_table); in destroy_zend_class()
452 if (ce->default_static_members_table) { in destroy_zend_class()
453 zval *p = ce->default_static_members_table; in destroy_zend_class()
454 zval *end = p + ce->default_static_members_count; in destroy_zend_class()
460 free(ce->default_static_members_table); in destroy_zend_class()
463 ZEND_HASH_MAP_FOREACH_PTR(&ce->properties_info, prop_info) { in destroy_zend_class()
464 if (prop_info->ce == ce) { in destroy_zend_class()
473 zend_hash_destroy(&ce->properties_info); in destroy_zend_class()
474 zend_string_release_ex(ce->name, 1); in destroy_zend_class()
477 ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, fn) { in destroy_zend_class()
478 if (fn->common.scope == ce) { in destroy_zend_class()
490 zend_hash_destroy(&ce->function_table); in destroy_zend_class()
491 if (zend_hash_num_elements(&ce->constants_table)) { in destroy_zend_class()
494 ZEND_HASH_MAP_FOREACH_PTR(&ce->constants_table, c) { in destroy_zend_class()
495 if (c->ce == ce) { in destroy_zend_class()
513 zend_hash_destroy(&ce->constants_table); in destroy_zend_class()
515 if (ce->iterator_funcs_ptr) { in destroy_zend_class()
516 free(ce->iterator_funcs_ptr); in destroy_zend_class()
518 if (ce->arrayaccess_funcs_ptr) { in destroy_zend_class()
519 free(ce->arrayaccess_funcs_ptr); in destroy_zend_class()
521 if (ce->num_interfaces > 0) { in destroy_zend_class()
522 free(ce->interfaces); in destroy_zend_class()
524 if (ce->properties_info_table) { in destroy_zend_class()
525 free(ce->properties_info_table); in destroy_zend_class()
527 if (ce->attributes) { in destroy_zend_class()
528 zend_hash_release(ce->attributes); in destroy_zend_class()
530 free(ce); in destroy_zend_class()
537 zend_class_entry *ce = Z_PTR_P(zv); in zend_class_add_ref() local
539 if (Z_TYPE_P(zv) != IS_ALIAS_PTR && !(ce->ce_flags & ZEND_ACC_IMMUTABLE)) { in zend_class_add_ref()
540 ce->refcount++; in zend_class_add_ref()