Skip to content

Commit c0be77a

Browse files
committed
Removed deprecated checks.
1 parent 908ce66 commit c0be77a

File tree

3 files changed

+15
-45
lines changed

3 files changed

+15
-45
lines changed

Zend/zend_API.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3334,12 +3334,6 @@ static zend_bool zend_is_callable_impl(zval *callable, zend_object *object, uint
33343334
fcc->function_handler = NULL;
33353335
fcc->object = NULL;
33363336

3337-
if (object &&
3338-
(!EG(objects_store).object_buckets ||
3339-
!IS_OBJ_VALID(EG(objects_store).object_buckets[object->handle]))) {
3340-
return 0;
3341-
}
3342-
33433337
again:
33443338
switch (Z_TYPE_P(callable)) {
33453339
case IS_STRING:
@@ -3398,10 +3392,6 @@ static zend_bool zend_is_callable_impl(zval *callable, zend_object *object, uint
33983392
}
33993393

34003394
} else if (Z_TYPE_P(obj) == IS_OBJECT) {
3401-
if (!EG(objects_store).object_buckets ||
3402-
!IS_OBJ_VALID(EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(obj)])) {
3403-
return 0;
3404-
}
34053395

34063396
fcc->calling_scope = Z_OBJCE_P(obj); /* TBFixed: what if it's overloaded? */
34073397

Zend/zend_execute_API.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -741,15 +741,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
741741

742742
call = zend_vm_stack_push_call_frame(ZEND_CALL_TOP_FUNCTION | ZEND_CALL_DYNAMIC,
743743
func, fci->param_count, fci_cache->called_scope, fci->object);
744-
if (fci->object &&
745-
(!EG(objects_store).object_buckets ||
746-
!IS_OBJ_VALID(EG(objects_store).object_buckets[fci->object->handle]))) {
747-
zend_vm_stack_free_call_frame(call);
748-
if (EG(current_execute_data) == &dummy_execute_data) {
749-
EG(current_execute_data) = dummy_execute_data.prev_execute_data;
750-
}
751-
return FAILURE;
752-
}
753744

754745
if (func->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) {
755746
if (func->common.fn_flags & ZEND_ACC_ABSTRACT) {

Zend/zend_gc.c

Lines changed: 15 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,7 @@ static void gc_scan_black(zend_refcounted *ref)
379379
zend_object_get_gc_t get_gc;
380380
zend_object *obj = (zend_object*)ref;
381381

382-
ZEND_ASSERT(EG(objects_store).object_buckets != NULL);
383382
if (EXPECTED(!(GC_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
384-
IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle]) &&
385383
(get_gc = obj->handlers->get_gc) != NULL)) {
386384
int n;
387385
zval *zv, *end;
@@ -491,9 +489,7 @@ static void gc_mark_grey(zend_refcounted *ref)
491489
zend_object_get_gc_t get_gc;
492490
zend_object *obj = (zend_object*)ref;
493491

494-
ZEND_ASSERT(EG(objects_store).object_buckets != NULL);
495492
if (EXPECTED(!(GC_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
496-
IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle]) &&
497493
(get_gc = obj->handlers->get_gc) != NULL)) {
498494
int n;
499495
zval *zv, *end;
@@ -606,9 +602,7 @@ static void gc_scan(zend_refcounted *ref)
606602
zend_object_get_gc_t get_gc;
607603
zend_object *obj = (zend_object*)ref;
608604

609-
ZEND_ASSERT(EG(objects_store).object_buckets != NULL);
610605
if (EXPECTED(!(GC_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
611-
IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle]) &&
612606
(get_gc = obj->handlers->get_gc) != NULL)) {
613607
int n;
614608
zval *zv, *end;
@@ -770,9 +764,7 @@ static int gc_collect_white(zend_refcounted *ref, uint32_t *flags)
770764
zend_object_get_gc_t get_gc;
771765
zend_object *obj = (zend_object*)ref;
772766

773-
ZEND_ASSERT(EG(objects_store).object_buckets != NULL);
774767
if (EXPECTED(!(GC_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
775-
IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle]) &&
776768
(get_gc = obj->handlers->get_gc) != NULL)) {
777769
int n;
778770
zval *zv, *end;
@@ -964,9 +956,7 @@ static void gc_remove_nested_data_from_buffer(zend_refcounted *ref, gc_root_buff
964956
zend_object_get_gc_t get_gc;
965957
zend_object *obj = (zend_object*)ref;
966958

967-
ZEND_ASSERT(EG(objects_store).object_buckets != NULL);
968959
if (EXPECTED(!(GC_FLAGS(ref) & IS_OBJ_FREE_CALLED) &&
969-
IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle]) &&
970960
(get_gc = obj->handlers->get_gc) != NULL)) {
971961
int n;
972962
zval *zv, *end;
@@ -1122,11 +1112,12 @@ ZEND_API int zend_gc_collect_cycles(void)
11221112
if (GC_TYPE(p) == IS_OBJECT) {
11231113
zend_object *obj = (zend_object*)p;
11241114

1125-
if (IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle]) &&
1126-
!(GC_FLAGS(obj) & IS_OBJ_DESTRUCTOR_CALLED)) {
1115+
if (!(GC_FLAGS(obj) & IS_OBJ_DESTRUCTOR_CALLED)) {
11271116
GC_TRACE_REF(obj, "calling destructor");
11281117
GC_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED;
1129-
if (obj->handlers->dtor_obj) {
1118+
if (obj->handlers->dtor_obj
1119+
&& (obj->handlers->dtor_obj != zend_objects_destroy_object
1120+
|| obj->ce->destructor)) {
11301121
GC_REFCOUNT(obj)++;
11311122
obj->handlers->dtor_obj(obj);
11321123
GC_REFCOUNT(obj)--;
@@ -1158,21 +1149,19 @@ ZEND_API int zend_gc_collect_cycles(void)
11581149
if (GC_TYPE(p) == IS_OBJECT) {
11591150
zend_object *obj = (zend_object*)p;
11601151

1161-
if (IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle])) {
1162-
EG(objects_store).object_buckets[obj->handle] = SET_OBJ_INVALID(obj);
1163-
GC_TYPE(obj) = IS_NULL;
1164-
if (!(GC_FLAGS(obj) & IS_OBJ_FREE_CALLED)) {
1165-
GC_FLAGS(obj) |= IS_OBJ_FREE_CALLED;
1166-
if (obj->handlers->free_obj) {
1167-
GC_REFCOUNT(obj)++;
1168-
obj->handlers->free_obj(obj);
1169-
GC_REFCOUNT(obj)--;
1170-
}
1152+
EG(objects_store).object_buckets[obj->handle] = SET_OBJ_INVALID(obj);
1153+
GC_TYPE(obj) = IS_NULL;
1154+
if (!(GC_FLAGS(obj) & IS_OBJ_FREE_CALLED)) {
1155+
GC_FLAGS(obj) |= IS_OBJ_FREE_CALLED;
1156+
if (obj->handlers->free_obj) {
1157+
GC_REFCOUNT(obj)++;
1158+
obj->handlers->free_obj(obj);
1159+
GC_REFCOUNT(obj)--;
11711160
}
1172-
SET_OBJ_BUCKET_NUMBER(EG(objects_store).object_buckets[obj->handle], EG(objects_store).free_list_head);
1173-
EG(objects_store).free_list_head = obj->handle;
1174-
p = current->ref = (zend_refcounted*)(((char*)obj) - obj->handlers->offset);
11751161
}
1162+
SET_OBJ_BUCKET_NUMBER(EG(objects_store).object_buckets[obj->handle], EG(objects_store).free_list_head);
1163+
EG(objects_store).free_list_head = obj->handle;
1164+
p = current->ref = (zend_refcounted*)(((char*)obj) - obj->handlers->offset);
11761165
} else if (GC_TYPE(p) == IS_ARRAY) {
11771166
zend_array *arr = (zend_array*)p;
11781167

0 commit comments

Comments
 (0)