Lines Matching refs:ce
711 static zend_op_array *zend_persist_class_method(zend_op_array *op_array, zend_class_entry *ce) in zend_persist_class_method() argument
737 … if (!op_array->scope || (op_array->scope == ce && !(op_array->fn_flags & ZEND_ACC_TRAIT_CLONE))) { in zend_persist_class_method()
770 if (ce->ce_flags & ZEND_ACC_IMMUTABLE) { in zend_persist_class_method()
772 if (ce->ce_flags & ZEND_ACC_LINKED) { in zend_persist_class_method()
787 zend_class_entry *ce; in zend_persist_property_info() local
789 ce = zend_shared_alloc_get_xlat_entry(prop->ce); in zend_persist_property_info()
790 if (ce) { in zend_persist_property_info()
791 prop->ce = ce; in zend_persist_property_info()
818 zend_op_array *hook = zend_persist_class_method(&prop->hooks[i]->op_array, ce); in zend_persist_property_info()
824 if (hook->scope == ce && !(hook->fn_flags & ZEND_ACC_TRAIT_CLONE)) { in zend_persist_property_info()
845 zend_class_entry *ce; in zend_persist_class_constant() local
850 …} else if (((orig_c->ce->ce_flags & ZEND_ACC_IMMUTABLE) && !(Z_CONSTANT_FLAGS(orig_c->value) & CON… in zend_persist_class_constant()
851 || orig_c->ce->type == ZEND_INTERNAL_CLASS) { in zend_persist_class_constant()
860 ce = zend_shared_alloc_get_xlat_entry(c->ce); in zend_persist_class_constant()
861 if (ce) { in zend_persist_class_constant()
862 c->ce = ce; in zend_persist_class_constant()
890 zend_class_entry *ce = orig_ce; in zend_persist_class_entry() local
892 if (ce->type == ZEND_USER_CLASS) { in zend_persist_class_entry()
894 zend_class_entry *new_ce = zend_shared_alloc_get_xlat_entry(ce); in zend_persist_class_entry()
898 ce = zend_shared_memdup_put(ce, sizeof(zend_class_entry)); in zend_persist_class_entry()
900 ce->ce_flags |= ZEND_ACC_IMMUTABLE; in zend_persist_class_entry()
901 if ((ce->ce_flags & ZEND_ACC_LINKED) in zend_persist_class_entry()
902 && !(ce->ce_flags & ZEND_ACC_CONSTANTS_UPDATED)) { in zend_persist_class_entry()
903 ZEND_MAP_PTR_NEW(ce->mutable_data); in zend_persist_class_entry()
905 ZEND_MAP_PTR_INIT(ce->mutable_data, NULL); in zend_persist_class_entry()
908 ce->ce_flags |= ZEND_ACC_FILE_CACHED; in zend_persist_class_entry()
910 ce->inheritance_cache = NULL; in zend_persist_class_entry()
912 if (!(ce->ce_flags & ZEND_ACC_CACHED)) { in zend_persist_class_entry()
913 if (ZSTR_HAS_CE_CACHE(ce->name)) { in zend_persist_class_entry()
914 ZSTR_SET_CE_CACHE_EX(ce->name, NULL, 0); in zend_persist_class_entry()
916 zend_accel_store_interned_string(ce->name); in zend_persist_class_entry()
917 if (!(ce->ce_flags & ZEND_ACC_ANON_CLASS) in zend_persist_class_entry()
919 zend_accel_get_class_name_map_ptr(ce->name); in zend_persist_class_entry()
921 if (ce->parent_name && !(ce->ce_flags & ZEND_ACC_LINKED)) { in zend_persist_class_entry()
922 zend_accel_store_interned_string(ce->parent_name); in zend_persist_class_entry()
926 zend_hash_persist(&ce->function_table); in zend_persist_class_entry()
927 ZEND_HASH_MAP_FOREACH_BUCKET(&ce->function_table, p) { in zend_persist_class_entry()
930 Z_PTR(p->val) = zend_persist_class_method(Z_PTR(p->val), ce); in zend_persist_class_entry()
932 HT_FLAGS(&ce->function_table) &= (HASH_FLAG_UNINITIALIZED | HASH_FLAG_STATIC_KEYS); in zend_persist_class_entry()
933 if (ce->default_properties_table) { in zend_persist_class_entry()
936 …ce->default_properties_table = zend_shared_memdup_free(ce->default_properties_table, sizeof(zval) … in zend_persist_class_entry()
937 for (i = 0; i < ce->default_properties_count; i++) { in zend_persist_class_entry()
938 zend_persist_zval(&ce->default_properties_table[i]); in zend_persist_class_entry()
941 if (ce->default_static_members_table) { in zend_persist_class_entry()
943 …ce->default_static_members_table = zend_shared_memdup_free(ce->default_static_members_table, sizeo… in zend_persist_class_entry()
947 for (i = 0; i < ce->default_static_members_count; i++) { in zend_persist_class_entry()
948 if (Z_TYPE(ce->default_static_members_table[i]) != IS_INDIRECT) { in zend_persist_class_entry()
949 zend_persist_zval(&ce->default_static_members_table[i]); in zend_persist_class_entry()
952 if (ce->ce_flags & ZEND_ACC_IMMUTABLE) { in zend_persist_class_entry()
953 if (ce->ce_flags & ZEND_ACC_LINKED) { in zend_persist_class_entry()
954 ZEND_MAP_PTR_NEW(ce->static_members_table); in zend_persist_class_entry()
956 ZEND_MAP_PTR_INIT(ce->static_members_table, NULL); in zend_persist_class_entry()
961 zend_hash_persist(&ce->constants_table); in zend_persist_class_entry()
962 ZEND_HASH_MAP_FOREACH_BUCKET(&ce->constants_table, p) { in zend_persist_class_entry()
967 HT_FLAGS(&ce->constants_table) &= (HASH_FLAG_UNINITIALIZED | HASH_FLAG_STATIC_KEYS); in zend_persist_class_entry()
969 zend_hash_persist(&ce->properties_info); in zend_persist_class_entry()
970 ZEND_HASH_MAP_FOREACH_BUCKET(&ce->properties_info, p) { in zend_persist_class_entry()
974 if (prop->ce == orig_ce) { in zend_persist_class_entry()
987 HT_FLAGS(&ce->properties_info) &= (HASH_FLAG_UNINITIALIZED | HASH_FLAG_STATIC_KEYS); in zend_persist_class_entry()
989 if (ce->properties_info_table) { in zend_persist_class_entry()
992 size_t size = sizeof(zend_property_info *) * ce->default_properties_count; in zend_persist_class_entry()
993 ZEND_ASSERT(ce->ce_flags & ZEND_ACC_LINKED); in zend_persist_class_entry()
994 ce->properties_info_table = zend_shared_memdup( in zend_persist_class_entry()
995 ce->properties_info_table, size); in zend_persist_class_entry()
997 for (i = 0; i < ce->default_properties_count; i++) { in zend_persist_class_entry()
998 if (ce->properties_info_table[i]) { in zend_persist_class_entry()
1000 ce->properties_info_table[i]); in zend_persist_class_entry()
1002 ce->properties_info_table[i] = prop_info; in zend_persist_class_entry()
1008 if (ce->iterator_funcs_ptr) { in zend_persist_class_entry()
1009 …ce->iterator_funcs_ptr = zend_shared_memdup(ce->iterator_funcs_ptr, sizeof(zend_class_iterator_fun… in zend_persist_class_entry()
1011 if (ce->arrayaccess_funcs_ptr) { in zend_persist_class_entry()
1012 …ce->arrayaccess_funcs_ptr = zend_shared_memdup(ce->arrayaccess_funcs_ptr, sizeof(zend_class_arraya… in zend_persist_class_entry()
1015 if (ce->ce_flags & ZEND_ACC_CACHED) { in zend_persist_class_entry()
1016 return ce; in zend_persist_class_entry()
1019 ce->ce_flags |= ZEND_ACC_CACHED; in zend_persist_class_entry()
1021 if (ce->info.user.filename) { in zend_persist_class_entry()
1022 zend_accel_store_string(ce->info.user.filename); in zend_persist_class_entry()
1025 if (ce->doc_comment) { in zend_persist_class_entry()
1027 zend_accel_store_interned_string(ce->doc_comment); in zend_persist_class_entry()
1029 if (!zend_shared_alloc_get_xlat_entry(ce->doc_comment)) { in zend_persist_class_entry()
1030 zend_shared_alloc_register_xlat_entry(ce->doc_comment, ce->doc_comment); in zend_persist_class_entry()
1031 zend_string_release_ex(ce->doc_comment, 0); in zend_persist_class_entry()
1033 ce->doc_comment = NULL; in zend_persist_class_entry()
1037 if (ce->attributes) { in zend_persist_class_entry()
1038 ce->attributes = zend_persist_attributes(ce->attributes); in zend_persist_class_entry()
1041 if (ce->num_interfaces && !(ce->ce_flags & ZEND_ACC_LINKED)) { in zend_persist_class_entry()
1044 for (i = 0; i < ce->num_interfaces; i++) { in zend_persist_class_entry()
1045 zend_accel_store_interned_string(ce->interface_names[i].name); in zend_persist_class_entry()
1046 zend_accel_store_interned_string(ce->interface_names[i].lc_name); in zend_persist_class_entry()
1048 …ce->interface_names = zend_shared_memdup_free(ce->interface_names, sizeof(zend_class_name) * ce->n… in zend_persist_class_entry()
1051 if (ce->num_traits) { in zend_persist_class_entry()
1054 for (i = 0; i < ce->num_traits; i++) { in zend_persist_class_entry()
1055 zend_accel_store_interned_string(ce->trait_names[i].name); in zend_persist_class_entry()
1056 zend_accel_store_interned_string(ce->trait_names[i].lc_name); in zend_persist_class_entry()
1058 …ce->trait_names = zend_shared_memdup_free(ce->trait_names, sizeof(zend_class_name) * ce->num_trait… in zend_persist_class_entry()
1061 if (ce->trait_aliases) { in zend_persist_class_entry()
1062 while (ce->trait_aliases[i]) { in zend_persist_class_entry()
1063 if (ce->trait_aliases[i]->trait_method.method_name) { in zend_persist_class_entry()
1064 zend_accel_store_interned_string(ce->trait_aliases[i]->trait_method.method_name); in zend_persist_class_entry()
1066 if (ce->trait_aliases[i]->trait_method.class_name) { in zend_persist_class_entry()
1067 zend_accel_store_interned_string(ce->trait_aliases[i]->trait_method.class_name); in zend_persist_class_entry()
1070 if (ce->trait_aliases[i]->alias) { in zend_persist_class_entry()
1071 zend_accel_store_interned_string(ce->trait_aliases[i]->alias); in zend_persist_class_entry()
1074 ce->trait_aliases[i] = zend_shared_memdup_free(ce->trait_aliases[i], sizeof(zend_trait_alias)); in zend_persist_class_entry()
1078 …ce->trait_aliases = zend_shared_memdup_free(ce->trait_aliases, sizeof(zend_trait_alias*) * (i + 1)… in zend_persist_class_entry()
1081 if (ce->trait_precedences) { in zend_persist_class_entry()
1085 while (ce->trait_precedences[i]) { in zend_persist_class_entry()
1086 zend_accel_store_interned_string(ce->trait_precedences[i]->trait_method.method_name); in zend_persist_class_entry()
1087 zend_accel_store_interned_string(ce->trait_precedences[i]->trait_method.class_name); in zend_persist_class_entry()
1089 for (j = 0; j < ce->trait_precedences[i]->num_excludes; j++) { in zend_persist_class_entry()
1090 zend_accel_store_interned_string(ce->trait_precedences[i]->exclude_class_names[j]); in zend_persist_class_entry()
1093 …ce->trait_precedences[i] = zend_shared_memdup_free(ce->trait_precedences[i], sizeof(zend_trait_pre… in zend_persist_class_entry()
1096 ce->trait_precedences = zend_shared_memdup_free( in zend_persist_class_entry()
1097 ce->trait_precedences, sizeof(zend_trait_precedence*) * (i + 1)); in zend_persist_class_entry()
1101 ZEND_ASSERT(ce->backed_enum_table == NULL); in zend_persist_class_entry()
1104 return ce; in zend_persist_class_entry()
1107 void zend_update_parent_ce(zend_class_entry *ce) in zend_update_parent_ce() argument
1109 if (ce->ce_flags & ZEND_ACC_LINKED) { in zend_update_parent_ce()
1110 if (ce->parent) { in zend_update_parent_ce()
1112 zend_class_entry *parent = ce->parent; in zend_update_parent_ce()
1118 ce->parent = parent = p; in zend_update_parent_ce()
1127 zval *p = &ce->default_static_members_table[i]; in zend_update_parent_ce()
1143 if (ce->num_interfaces) { in zend_update_parent_ce()
1146 …ce->interfaces = zend_shared_memdup_free(ce->interfaces, sizeof(zend_class_entry*) * ce->num_inter… in zend_update_parent_ce()
1147 for (i = 0; i < ce->num_interfaces; i++) { in zend_update_parent_ce()
1148 if (ce->interfaces[i]->type == ZEND_USER_CLASS) { in zend_update_parent_ce()
1149 zend_class_entry *tmp = zend_shared_alloc_get_xlat_entry(ce->interfaces[i]); in zend_update_parent_ce()
1151 ce->interfaces[i] = tmp; in zend_update_parent_ce()
1157 if (ce->iterator_funcs_ptr) { in zend_update_parent_ce()
1158 memset(ce->iterator_funcs_ptr, 0, sizeof(zend_class_iterator_funcs)); in zend_update_parent_ce()
1159 if (zend_class_implements_interface(ce, zend_ce_aggregate)) { in zend_update_parent_ce()
1160 …ce->iterator_funcs_ptr->zf_new_iterator = zend_hash_str_find_ptr(&ce->function_table, "getiterator… in zend_update_parent_ce()
1162 if (zend_class_implements_interface(ce, zend_ce_iterator)) { in zend_update_parent_ce()
1163 …ce->iterator_funcs_ptr->zf_rewind = zend_hash_str_find_ptr(&ce->function_table, "rewind", sizeof("… in zend_update_parent_ce()
1164 …ce->iterator_funcs_ptr->zf_valid = zend_hash_str_find_ptr(&ce->function_table, "valid", sizeof("va… in zend_update_parent_ce()
1165 …ce->iterator_funcs_ptr->zf_key = zend_hash_find_ptr(&ce->function_table, ZSTR_KNOWN(ZEND_STR_KEY)); in zend_update_parent_ce()
1166 …ce->iterator_funcs_ptr->zf_current = zend_hash_str_find_ptr(&ce->function_table, "current", sizeof… in zend_update_parent_ce()
1167 …ce->iterator_funcs_ptr->zf_next = zend_hash_str_find_ptr(&ce->function_table, "next", sizeof("next… in zend_update_parent_ce()
1171 if (ce->arrayaccess_funcs_ptr) { in zend_update_parent_ce()
1172 ZEND_ASSERT(zend_class_implements_interface(ce, zend_ce_arrayaccess)); in zend_update_parent_ce()
1173 …ce->arrayaccess_funcs_ptr->zf_offsetget = zend_hash_str_find_ptr(&ce->function_table, "offsetget",… in zend_update_parent_ce()
1174 …ce->arrayaccess_funcs_ptr->zf_offsetexists = zend_hash_str_find_ptr(&ce->function_table, "offsetex… in zend_update_parent_ce()
1175 …ce->arrayaccess_funcs_ptr->zf_offsetset = zend_hash_str_find_ptr(&ce->function_table, "offsetset",… in zend_update_parent_ce()
1176 …ce->arrayaccess_funcs_ptr->zf_offsetunset = zend_hash_str_find_ptr(&ce->function_table, "offsetuns… in zend_update_parent_ce()
1181 if (ce->constructor) { in zend_update_parent_ce()
1182 zend_function *tmp = zend_shared_alloc_get_xlat_entry(ce->constructor); in zend_update_parent_ce()
1184 ce->constructor = tmp; in zend_update_parent_ce()
1187 if (ce->destructor) { in zend_update_parent_ce()
1188 zend_function *tmp = zend_shared_alloc_get_xlat_entry(ce->destructor); in zend_update_parent_ce()
1190 ce->destructor = tmp; in zend_update_parent_ce()
1193 if (ce->clone) { in zend_update_parent_ce()
1194 zend_function *tmp = zend_shared_alloc_get_xlat_entry(ce->clone); in zend_update_parent_ce()
1196 ce->clone = tmp; in zend_update_parent_ce()
1199 if (ce->__get) { in zend_update_parent_ce()
1200 zend_function *tmp = zend_shared_alloc_get_xlat_entry(ce->__get); in zend_update_parent_ce()
1202 ce->__get = tmp; in zend_update_parent_ce()
1205 if (ce->__set) { in zend_update_parent_ce()
1206 zend_function *tmp = zend_shared_alloc_get_xlat_entry(ce->__set); in zend_update_parent_ce()
1208 ce->__set = tmp; in zend_update_parent_ce()
1211 if (ce->__call) { in zend_update_parent_ce()
1212 zend_function *tmp = zend_shared_alloc_get_xlat_entry(ce->__call); in zend_update_parent_ce()
1214 ce->__call = tmp; in zend_update_parent_ce()
1217 if (ce->__serialize) { in zend_update_parent_ce()
1218 zend_function *tmp = zend_shared_alloc_get_xlat_entry(ce->__serialize); in zend_update_parent_ce()
1220 ce->__serialize = tmp; in zend_update_parent_ce()
1223 if (ce->__unserialize) { in zend_update_parent_ce()
1224 zend_function *tmp = zend_shared_alloc_get_xlat_entry(ce->__unserialize); in zend_update_parent_ce()
1226 ce->__unserialize = tmp; in zend_update_parent_ce()
1229 if (ce->__isset) { in zend_update_parent_ce()
1230 zend_function *tmp = zend_shared_alloc_get_xlat_entry(ce->__isset); in zend_update_parent_ce()
1232 ce->__isset = tmp; in zend_update_parent_ce()
1235 if (ce->__unset) { in zend_update_parent_ce()
1236 zend_function *tmp = zend_shared_alloc_get_xlat_entry(ce->__unset); in zend_update_parent_ce()
1238 ce->__unset = tmp; in zend_update_parent_ce()
1241 if (ce->__tostring) { in zend_update_parent_ce()
1242 zend_function *tmp = zend_shared_alloc_get_xlat_entry(ce->__tostring); in zend_update_parent_ce()
1244 ce->__tostring = tmp; in zend_update_parent_ce()
1247 if (ce->__callstatic) { in zend_update_parent_ce()
1248 zend_function *tmp = zend_shared_alloc_get_xlat_entry(ce->__callstatic); in zend_update_parent_ce()
1250 ce->__callstatic = tmp; in zend_update_parent_ce()
1253 if (ce->__debugInfo) { in zend_update_parent_ce()
1254 zend_function *tmp = zend_shared_alloc_get_xlat_entry(ce->__debugInfo); in zend_update_parent_ce()
1256 ce->__debugInfo = tmp; in zend_update_parent_ce()
1264 zend_class_entry *ce; in zend_accel_persist_class_table() local
1278 ce = Z_PTR(p->val); in zend_accel_persist_class_table()
1279 zend_update_parent_ce(ce); in zend_accel_persist_class_table()
1290 ce = Z_PTR(p->val); in zend_accel_persist_class_table()
1291 ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, op_array) { in zend_accel_persist_class_table()
1293 if (op_array->scope == ce in zend_accel_persist_class_table()
1307 ce = Z_PTR(p->val); in zend_accel_persist_class_table()
1308 ZEND_HASH_MAP_FOREACH_PTR(&ce->function_table, op_array) { in zend_accel_persist_class_table()
1311 if ((op_array->scope != ce in zend_accel_persist_class_table()