Skip to content

Commit 7b20c51

Browse files
committed
Remove unused zend_class_arrayaccess_funcs struct now
1 parent 0e4598a commit 7b20c51

9 files changed

+0
-58
lines changed

Zend/zend.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,6 @@ struct _zend_class_entry {
188188

189189
/* allocated only if class implements Iterator or IteratorAggregate interface */
190190
zend_class_iterator_funcs *iterator_funcs_ptr;
191-
/* allocated only if class implements ArrayAccess interface */
192-
zend_class_arrayaccess_funcs *arrayaccess_funcs_ptr;
193191

194192
/* handlers */
195193
union {

Zend/zend_API.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,6 @@ typedef struct _zend_fcall_info_cache {
316316
class_container.interfaces = NULL; \
317317
class_container.get_iterator = NULL; \
318318
class_container.iterator_funcs_ptr = NULL; \
319-
class_container.arrayaccess_funcs_ptr = NULL; \
320319
class_container.dimension_handlers = NULL; \
321320
class_container.info.internal.module = NULL; \
322321
class_container.info.internal.builtin_functions = functions; \

Zend/zend_compile.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2040,7 +2040,6 @@ ZEND_API void zend_initialize_class_data(zend_class_entry *ce, bool nullify_hand
20402040
ce->create_object = NULL;
20412041
ce->get_iterator = NULL;
20422042
ce->iterator_funcs_ptr = NULL;
2043-
ce->arrayaccess_funcs_ptr = NULL;
20442043
ce->get_static_method = NULL;
20452044
ce->parent = NULL;
20462045
ce->parent_name = NULL;

Zend/zend_dimension_handlers.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,4 @@ typedef struct _zend_class_dimensions_functions {
3636
void (*/* const */ unset_dimension)(zend_object *object, zval *offset);
3737
} zend_class_dimensions_functions;
3838

39-
typedef struct _zend_class_arrayaccess_funcs {
40-
zend_function *zf_offsetget;
41-
zend_function *zf_offsetexists;
42-
zend_function *zf_offsetset;
43-
zend_function *zf_offsetunset;
44-
} zend_class_arrayaccess_funcs;
45-
4639
#endif /* ZEND_DIMENSION_HANDLERS_H */

Zend/zend_interfaces_dimension.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -261,21 +261,6 @@ static int zend_implement_arrayaccess(zend_class_entry *interface, zend_class_en
261261
return SUCCESS;
262262
}
263263

264-
ZEND_ASSERT(!class_type->arrayaccess_funcs_ptr && "ArrayAccess funcs already set?");
265-
zend_class_arrayaccess_funcs *funcs_ptr = class_type->type == ZEND_INTERNAL_CLASS
266-
? pemalloc(sizeof(zend_class_arrayaccess_funcs), 1)
267-
: zend_arena_alloc(&CG(arena), sizeof(zend_class_arrayaccess_funcs));
268-
class_type->arrayaccess_funcs_ptr = funcs_ptr;
269-
270-
funcs_ptr->zf_offsetget = zend_hash_str_find_ptr(
271-
&class_type->function_table, "offsetget", sizeof("offsetget") - 1);
272-
funcs_ptr->zf_offsetexists = zend_hash_str_find_ptr(
273-
&class_type->function_table, "offsetexists", sizeof("offsetexists") - 1);
274-
funcs_ptr->zf_offsetset = zend_hash_str_find_ptr(
275-
&class_type->function_table, "offsetset", sizeof("offsetset") - 1);
276-
funcs_ptr->zf_offsetunset = zend_hash_str_find_ptr(
277-
&class_type->function_table, "offsetunset", sizeof("offsetunset") - 1);
278-
279264
zend_class_dimensions_functions *funcs = NULL;
280265
ALLOC_HANDLERS_IF_MISSING(funcs, class_type);
281266

Zend/zend_opcode.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -508,9 +508,6 @@ ZEND_API void destroy_zend_class(zval *zv)
508508
if (ce->iterator_funcs_ptr) {
509509
free(ce->iterator_funcs_ptr);
510510
}
511-
if (ce->arrayaccess_funcs_ptr) {
512-
free(ce->arrayaccess_funcs_ptr);
513-
}
514511
if (ce->num_interfaces > 0) {
515512
free(ce->interfaces);
516513
}

ext/opcache/zend_file_cache.c

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -874,14 +874,6 @@ static void zend_file_cache_serialize_class(zval *zv,
874874
SERIALIZE_PTR(ce->iterator_funcs_ptr->zf_next);
875875
SERIALIZE_PTR(ce->iterator_funcs_ptr);
876876
}
877-
878-
if (ce->arrayaccess_funcs_ptr) {
879-
SERIALIZE_PTR(ce->arrayaccess_funcs_ptr->zf_offsetget);
880-
SERIALIZE_PTR(ce->arrayaccess_funcs_ptr->zf_offsetexists);
881-
SERIALIZE_PTR(ce->arrayaccess_funcs_ptr->zf_offsetset);
882-
SERIALIZE_PTR(ce->arrayaccess_funcs_ptr->zf_offsetunset);
883-
SERIALIZE_PTR(ce->arrayaccess_funcs_ptr);
884-
}
885877
if (ce->dimension_handlers) {
886878
SERIALIZE_PTR(ce->dimension_handlers->read_dimension);
887879
SERIALIZE_PTR(ce->dimension_handlers->has_dimension);
@@ -1711,13 +1703,6 @@ static void zend_file_cache_unserialize_class(zval *zv,
17111703
UNSERIALIZE_PTR(ce->iterator_funcs_ptr->zf_current);
17121704
UNSERIALIZE_PTR(ce->iterator_funcs_ptr->zf_next);
17131705
}
1714-
if (ce->arrayaccess_funcs_ptr) {
1715-
UNSERIALIZE_PTR(ce->arrayaccess_funcs_ptr);
1716-
UNSERIALIZE_PTR(ce->arrayaccess_funcs_ptr->zf_offsetget);
1717-
UNSERIALIZE_PTR(ce->arrayaccess_funcs_ptr->zf_offsetexists);
1718-
UNSERIALIZE_PTR(ce->arrayaccess_funcs_ptr->zf_offsetset);
1719-
UNSERIALIZE_PTR(ce->arrayaccess_funcs_ptr->zf_offsetunset);
1720-
}
17211706
if (ce->dimension_handlers) {
17221707
UNSERIALIZE_PTR(ce->dimension_handlers);
17231708
UNSERIALIZE_PTR(ce->dimension_handlers->read_dimension);

ext/opcache/zend_persist.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -975,9 +975,6 @@ zend_class_entry *zend_persist_class_entry(zend_class_entry *orig_ce)
975975
if (ce->iterator_funcs_ptr) {
976976
ce->iterator_funcs_ptr = zend_shared_memdup(ce->iterator_funcs_ptr, sizeof(zend_class_iterator_funcs));
977977
}
978-
if (ce->arrayaccess_funcs_ptr) {
979-
ce->arrayaccess_funcs_ptr = zend_shared_memdup(ce->arrayaccess_funcs_ptr, sizeof(zend_class_arrayaccess_funcs));
980-
}
981978
if (ce->dimension_handlers) {
982979
ce->dimension_handlers = zend_shared_memdup(ce->dimension_handlers, sizeof(zend_class_dimensions_functions));
983980
}
@@ -1137,14 +1134,6 @@ void zend_update_parent_ce(zend_class_entry *ce)
11371134
ce->iterator_funcs_ptr->zf_next = zend_hash_str_find_ptr(&ce->function_table, "next", sizeof("next") - 1);
11381135
}
11391136
}
1140-
1141-
if (ce->arrayaccess_funcs_ptr) {
1142-
ZEND_ASSERT(zend_class_implements_interface(ce, zend_ce_arrayaccess));
1143-
ce->arrayaccess_funcs_ptr->zf_offsetget = zend_hash_str_find_ptr(&ce->function_table, "offsetget", sizeof("offsetget") - 1);
1144-
ce->arrayaccess_funcs_ptr->zf_offsetexists = zend_hash_str_find_ptr(&ce->function_table, "offsetexists", sizeof("offsetexists") - 1);
1145-
ce->arrayaccess_funcs_ptr->zf_offsetset = zend_hash_str_find_ptr(&ce->function_table, "offsetset", sizeof("offsetset") - 1);
1146-
ce->arrayaccess_funcs_ptr->zf_offsetunset = zend_hash_str_find_ptr(&ce->function_table, "offsetunset", sizeof("offsetunset") - 1);
1147-
}
11481137
}
11491138

11501139
/* update methods */

ext/opcache/zend_persist_calc.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -481,9 +481,6 @@ void zend_persist_class_entry_calc(zend_class_entry *ce)
481481
if (ce->iterator_funcs_ptr) {
482482
ADD_SIZE(sizeof(zend_class_iterator_funcs));
483483
}
484-
if (ce->arrayaccess_funcs_ptr) {
485-
ADD_SIZE(sizeof(zend_class_arrayaccess_funcs));
486-
}
487484
if (ce->dimension_handlers) {
488485
ADD_SIZE(sizeof(zend_class_dimensions_functions));
489486
}

0 commit comments

Comments
 (0)