Lines Matching refs:ce

172 ZEND_API void zend_cleanup_internal_class_data(zend_class_entry *ce)  in zend_cleanup_internal_class_data()  argument
174 if (ZEND_MAP_PTR(ce->static_members_table) && CE_STATIC_MEMBERS(ce)) { in zend_cleanup_internal_class_data()
175 zval *static_members = CE_STATIC_MEMBERS(ce); in zend_cleanup_internal_class_data()
177 zval *end = p + ce->default_static_members_count; in zend_cleanup_internal_class_data()
178 ZEND_MAP_PTR_SET(ce->static_members_table, NULL); in zend_cleanup_internal_class_data()
183 if (prop_info->ce == ce && p - static_members == prop_info->offset) { in zend_cleanup_internal_class_data()
196 static void _destroy_zend_class_traits_info(zend_class_entry *ce) in _destroy_zend_class_traits_info() argument
200 for (i = 0; i < ce->num_traits; i++) { in _destroy_zend_class_traits_info()
201 zend_string_release_ex(ce->trait_names[i].name, 0); in _destroy_zend_class_traits_info()
202 zend_string_release_ex(ce->trait_names[i].lc_name, 0); in _destroy_zend_class_traits_info()
204 efree(ce->trait_names); in _destroy_zend_class_traits_info()
206 if (ce->trait_aliases) { in _destroy_zend_class_traits_info()
208 while (ce->trait_aliases[i]) { in _destroy_zend_class_traits_info()
209 if (ce->trait_aliases[i]->trait_method.method_name) { in _destroy_zend_class_traits_info()
210 zend_string_release_ex(ce->trait_aliases[i]->trait_method.method_name, 0); in _destroy_zend_class_traits_info()
212 if (ce->trait_aliases[i]->trait_method.class_name) { in _destroy_zend_class_traits_info()
213 zend_string_release_ex(ce->trait_aliases[i]->trait_method.class_name, 0); in _destroy_zend_class_traits_info()
216 if (ce->trait_aliases[i]->alias) { in _destroy_zend_class_traits_info()
217 zend_string_release_ex(ce->trait_aliases[i]->alias, 0); in _destroy_zend_class_traits_info()
220 efree(ce->trait_aliases[i]); in _destroy_zend_class_traits_info()
224 efree(ce->trait_aliases); in _destroy_zend_class_traits_info()
227 if (ce->trait_precedences) { in _destroy_zend_class_traits_info()
231 while (ce->trait_precedences[i]) { in _destroy_zend_class_traits_info()
232 zend_string_release_ex(ce->trait_precedences[i]->trait_method.method_name, 0); in _destroy_zend_class_traits_info()
233 zend_string_release_ex(ce->trait_precedences[i]->trait_method.class_name, 0); in _destroy_zend_class_traits_info()
235 for (j = 0; j < ce->trait_precedences[i]->num_excludes; j++) { in _destroy_zend_class_traits_info()
236 zend_string_release_ex(ce->trait_precedences[i]->exclude_class_names[j], 0); in _destroy_zend_class_traits_info()
238 efree(ce->trait_precedences[i]); in _destroy_zend_class_traits_info()
241 efree(ce->trait_precedences); in _destroy_zend_class_traits_info()
245 ZEND_API void zend_cleanup_mutable_class_data(zend_class_entry *ce) in zend_cleanup_mutable_class_data() argument
247 zend_class_mutable_data *mutable_data = ZEND_MAP_PTR_GET_IMM(ce->mutable_data); in zend_cleanup_mutable_class_data()
254 if (constants_table && constants_table != &ce->constants_table) { in zend_cleanup_mutable_class_data()
258 if (c->ce == ce || (Z_CONSTANT_FLAGS(c->value) & CONST_OWNED)) { in zend_cleanup_mutable_class_data()
267 if (p && p != ce->default_properties_table) { in zend_cleanup_mutable_class_data()
268 zval *end = p + ce->default_properties_count; in zend_cleanup_mutable_class_data()
282 ZEND_MAP_PTR_SET_IMM(ce->mutable_data, NULL); in zend_cleanup_mutable_class_data()
289 zend_class_entry *ce = Z_PTR_P(zv); in destroy_zend_class() local
292 if (ce->ce_flags & ZEND_ACC_IMMUTABLE) { in destroy_zend_class()
302 if (ce->ce_flags & ZEND_ACC_FILE_CACHED) { in destroy_zend_class()
306 ZEND_HASH_MAP_FOREACH_PTR(&ce->constants_table, c) { in destroy_zend_class()
307 if (c->ce == ce) { in destroy_zend_class()
312 if (ce->default_properties_table) { in destroy_zend_class()
313 p = ce->default_properties_table; in destroy_zend_class()
314 end = p + ce->default_properties_count; in destroy_zend_class()
324 ZEND_ASSERT(ce->refcount > 0); in destroy_zend_class()
326 if (--ce->refcount > 0) { in destroy_zend_class()
330 switch (ce->type) { in destroy_zend_class()
332 if (!(ce->ce_flags & ZEND_ACC_CACHED)) { in destroy_zend_class()
333 if (ce->parent_name && !(ce->ce_flags & ZEND_ACC_RESOLVED_PARENT)) { in destroy_zend_class()
334 zend_string_release_ex(ce->parent_name, 0); in destroy_zend_class()
337 zend_string_release_ex(ce->name, 0); in destroy_zend_class()
338 zend_string_release_ex(ce->info.user.filename, 0); in destroy_zend_class()
340 if (ce->info.user.doc_comment) { in destroy_zend_class()
341 zend_string_release_ex(ce->info.user.doc_comment, 0); in destroy_zend_class()
344 if (ce->attributes) { in destroy_zend_class()
345 zend_hash_release(ce->attributes); in destroy_zend_class()
348 if (ce->num_interfaces > 0 && !(ce->ce_flags & ZEND_ACC_RESOLVED_INTERFACES)) { in destroy_zend_class()
351 for (i = 0; i < ce->num_interfaces; i++) { in destroy_zend_class()
352 zend_string_release_ex(ce->interface_names[i].name, 0); in destroy_zend_class()
353 zend_string_release_ex(ce->interface_names[i].lc_name, 0); in destroy_zend_class()
355 efree(ce->interface_names); in destroy_zend_class()
358 if (ce->num_traits > 0) { in destroy_zend_class()
359 _destroy_zend_class_traits_info(ce); in destroy_zend_class()
363 if (ce->default_properties_table) { in destroy_zend_class()
364 zval *p = ce->default_properties_table; in destroy_zend_class()
365 zval *end = p + ce->default_properties_count; in destroy_zend_class()
371 efree(ce->default_properties_table); in destroy_zend_class()
373 if (ce->default_static_members_table) { in destroy_zend_class()
374 zval *p = ce->default_static_members_table; in destroy_zend_class()
375 zval *end = p + ce->default_static_members_count; in destroy_zend_class()
382 efree(ce->default_static_members_table); in destroy_zend_class()
384 ZEND_HASH_MAP_FOREACH_PTR(&ce->properties_info, prop_info) { in destroy_zend_class()
385 if (prop_info->ce == ce) { in destroy_zend_class()
396 zend_hash_destroy(&ce->properties_info); in destroy_zend_class()
397 zend_hash_destroy(&ce->function_table); in destroy_zend_class()
398 if (zend_hash_num_elements(&ce->constants_table)) { in destroy_zend_class()
401 ZEND_HASH_MAP_FOREACH_PTR(&ce->constants_table, c) { in destroy_zend_class()
402 if (c->ce == ce || (Z_CONSTANT_FLAGS(c->value) & CONST_OWNED)) { in destroy_zend_class()
413 zend_hash_destroy(&ce->constants_table); in destroy_zend_class()
414 if (ce->num_interfaces > 0 && (ce->ce_flags & ZEND_ACC_RESOLVED_INTERFACES)) { in destroy_zend_class()
415 efree(ce->interfaces); in destroy_zend_class()
417 if (ce->backed_enum_table) { in destroy_zend_class()
418 zend_hash_release(ce->backed_enum_table); in destroy_zend_class()
422 if (ce->backed_enum_table) { in destroy_zend_class()
423 zend_hash_release(ce->backed_enum_table); in destroy_zend_class()
425 if (ce->default_properties_table) { in destroy_zend_class()
426 zval *p = ce->default_properties_table; in destroy_zend_class()
427 zval *end = p + ce->default_properties_count; in destroy_zend_class()
433 free(ce->default_properties_table); in destroy_zend_class()
435 if (ce->default_static_members_table) { in destroy_zend_class()
436 zval *p = ce->default_static_members_table; in destroy_zend_class()
437 zval *end = p + ce->default_static_members_count; in destroy_zend_class()
443 free(ce->default_static_members_table); in destroy_zend_class()
446 ZEND_HASH_MAP_FOREACH_PTR(&ce->properties_info, prop_info) { in destroy_zend_class()
447 if (prop_info->ce == ce) { in destroy_zend_class()
456 zend_hash_destroy(&ce->properties_info); in destroy_zend_class()
457 zend_string_release_ex(ce->name, 1); in destroy_zend_class()
460 ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, fn) { in destroy_zend_class()
461 if (fn->common.scope == ce) { in destroy_zend_class()
473 zend_hash_destroy(&ce->function_table); in destroy_zend_class()
474 if (zend_hash_num_elements(&ce->constants_table)) { in destroy_zend_class()
477 ZEND_HASH_MAP_FOREACH_PTR(&ce->constants_table, c) { in destroy_zend_class()
478 if (c->ce == ce) { in destroy_zend_class()
496 zend_hash_destroy(&ce->constants_table); in destroy_zend_class()
498 if (ce->iterator_funcs_ptr) { in destroy_zend_class()
499 free(ce->iterator_funcs_ptr); in destroy_zend_class()
501 if (ce->arrayaccess_funcs_ptr) { in destroy_zend_class()
502 free(ce->arrayaccess_funcs_ptr); in destroy_zend_class()
504 if (ce->num_interfaces > 0) { in destroy_zend_class()
505 free(ce->interfaces); in destroy_zend_class()
507 if (ce->properties_info_table) { in destroy_zend_class()
508 free(ce->properties_info_table); in destroy_zend_class()
510 if (ce->attributes) { in destroy_zend_class()
511 zend_hash_release(ce->attributes); in destroy_zend_class()
513 free(ce); in destroy_zend_class()
520 zend_class_entry *ce = Z_PTR_P(zv); in zend_class_add_ref() local
522 if (Z_TYPE_P(zv) != IS_ALIAS_PTR && !(ce->ce_flags & ZEND_ACC_IMMUTABLE)) { in zend_class_add_ref()
523 ce->refcount++; in zend_class_add_ref()