@@ -1099,8 +1099,7 @@ static zend_always_inline bool zend_value_instanceof_static(zval *zv) {
1099
1099
return instanceof_function (Z_OBJCE_P (zv ), called_scope );
1100
1100
}
1101
1101
1102
- // TODO: new name
1103
- static zend_always_inline zend_class_entry * zend_fetch_ce_from_cache_slot (
1102
+ static zend_always_inline zend_class_entry * zend_fetch_ce_from_type (
1104
1103
zend_type * type )
1105
1104
{
1106
1105
zend_string * name = ZEND_TYPE_NAME (* type );
@@ -1124,13 +1123,13 @@ static zend_always_inline zend_class_entry *zend_fetch_ce_from_cache_slot(
1124
1123
return ce ;
1125
1124
}
1126
1125
1127
- static bool zend_check_intersection_type_from_cache_slot (zend_type_list * intersection_type_list ,
1126
+ static bool zend_check_intersection_type_from_list (zend_type_list * intersection_type_list ,
1128
1127
zend_class_entry * arg_ce )
1129
1128
{
1130
1129
zend_class_entry * ce ;
1131
1130
zend_type * list_type ;
1132
1131
ZEND_TYPE_LIST_FOREACH (intersection_type_list , list_type ) {
1133
- ce = zend_fetch_ce_from_cache_slot (list_type );
1132
+ ce = zend_fetch_ce_from_type (list_type );
1134
1133
/* If type is not an instance of one of the types taking part in the
1135
1134
* intersection it cannot be a valid instance of the whole intersection type. */
1136
1135
if (!ce || !instanceof_function (arg_ce , ce )) {
@@ -1150,16 +1149,16 @@ static zend_always_inline bool zend_check_type_slow(
1150
1149
if (UNEXPECTED (ZEND_TYPE_HAS_LIST (* type ))) {
1151
1150
zend_type * list_type ;
1152
1151
if (ZEND_TYPE_IS_INTERSECTION (* type )) {
1153
- return zend_check_intersection_type_from_cache_slot (ZEND_TYPE_LIST (* type ), Z_OBJCE_P (arg ));
1152
+ return zend_check_intersection_type_from_list (ZEND_TYPE_LIST (* type ), Z_OBJCE_P (arg ));
1154
1153
} else {
1155
1154
ZEND_TYPE_LIST_FOREACH (ZEND_TYPE_LIST (* type ), list_type ) {
1156
1155
if (ZEND_TYPE_IS_INTERSECTION (* list_type )) {
1157
- if (zend_check_intersection_type_from_cache_slot (ZEND_TYPE_LIST (* list_type ), Z_OBJCE_P (arg ))) {
1156
+ if (zend_check_intersection_type_from_list (ZEND_TYPE_LIST (* list_type ), Z_OBJCE_P (arg ))) {
1158
1157
return true;
1159
1158
}
1160
1159
} else {
1161
1160
ZEND_ASSERT (!ZEND_TYPE_HAS_LIST (* list_type ));
1162
- ce = zend_fetch_ce_from_cache_slot (list_type );
1161
+ ce = zend_fetch_ce_from_type (list_type );
1163
1162
/* Instance of a single type part of a union is sufficient to pass the type check */
1164
1163
if (ce && instanceof_function (Z_OBJCE_P (arg ), ce )) {
1165
1164
return true;
@@ -1168,7 +1167,7 @@ static zend_always_inline bool zend_check_type_slow(
1168
1167
} ZEND_TYPE_LIST_FOREACH_END ();
1169
1168
}
1170
1169
} else {
1171
- ce = zend_fetch_ce_from_cache_slot (type );
1170
+ ce = zend_fetch_ce_from_type (type );
1172
1171
/* If we have a CE we check if it satisfies the type constraint,
1173
1172
* otherwise it will check if a standard type satisfies it. */
1174
1173
if (ce && instanceof_function (Z_OBJCE_P (arg ), ce )) {
0 commit comments