From: Dmitry Stogov Date: Tue, 27 Jun 2017 10:12:09 +0000 (+0300) Subject: Removed deprecated checks. X-Git-Tag: php-7.2.0alpha3~31 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c0be77aa75f4c8d926eb4979f4b6213dfd0b3a0a;p=php Removed deprecated checks. --- diff --git a/Zend/zend_API.c b/Zend/zend_API.c index bf2619e8e2..2a0fafbedb 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -3334,12 +3334,6 @@ static zend_bool zend_is_callable_impl(zval *callable, zend_object *object, uint fcc->function_handler = NULL; fcc->object = NULL; - if (object && - (!EG(objects_store).object_buckets || - !IS_OBJ_VALID(EG(objects_store).object_buckets[object->handle]))) { - return 0; - } - again: switch (Z_TYPE_P(callable)) { case IS_STRING: @@ -3398,10 +3392,6 @@ again: } } else if (Z_TYPE_P(obj) == IS_OBJECT) { - if (!EG(objects_store).object_buckets || - !IS_OBJ_VALID(EG(objects_store).object_buckets[Z_OBJ_HANDLE_P(obj)])) { - return 0; - } fcc->calling_scope = Z_OBJCE_P(obj); /* TBFixed: what if it's overloaded? */ diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 5e02b78af1..77345c4286 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -741,15 +741,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) / call = zend_vm_stack_push_call_frame(ZEND_CALL_TOP_FUNCTION | ZEND_CALL_DYNAMIC, func, fci->param_count, fci_cache->called_scope, fci->object); - if (fci->object && - (!EG(objects_store).object_buckets || - !IS_OBJ_VALID(EG(objects_store).object_buckets[fci->object->handle]))) { - zend_vm_stack_free_call_frame(call); - if (EG(current_execute_data) == &dummy_execute_data) { - EG(current_execute_data) = dummy_execute_data.prev_execute_data; - } - return FAILURE; - } if (func->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) { if (func->common.fn_flags & ZEND_ACC_ABSTRACT) { diff --git a/Zend/zend_gc.c b/Zend/zend_gc.c index 31bec4cb50..d8757d07ad 100644 --- a/Zend/zend_gc.c +++ b/Zend/zend_gc.c @@ -379,9 +379,7 @@ tail_call: zend_object_get_gc_t get_gc; zend_object *obj = (zend_object*)ref; - ZEND_ASSERT(EG(objects_store).object_buckets != NULL); if (EXPECTED(!(GC_FLAGS(ref) & IS_OBJ_FREE_CALLED) && - IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle]) && (get_gc = obj->handlers->get_gc) != NULL)) { int n; zval *zv, *end; @@ -491,9 +489,7 @@ tail_call: zend_object_get_gc_t get_gc; zend_object *obj = (zend_object*)ref; - ZEND_ASSERT(EG(objects_store).object_buckets != NULL); if (EXPECTED(!(GC_FLAGS(ref) & IS_OBJ_FREE_CALLED) && - IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle]) && (get_gc = obj->handlers->get_gc) != NULL)) { int n; zval *zv, *end; @@ -606,9 +602,7 @@ tail_call: zend_object_get_gc_t get_gc; zend_object *obj = (zend_object*)ref; - ZEND_ASSERT(EG(objects_store).object_buckets != NULL); if (EXPECTED(!(GC_FLAGS(ref) & IS_OBJ_FREE_CALLED) && - IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle]) && (get_gc = obj->handlers->get_gc) != NULL)) { int n; zval *zv, *end; @@ -770,9 +764,7 @@ tail_call: zend_object_get_gc_t get_gc; zend_object *obj = (zend_object*)ref; - ZEND_ASSERT(EG(objects_store).object_buckets != NULL); if (EXPECTED(!(GC_FLAGS(ref) & IS_OBJ_FREE_CALLED) && - IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle]) && (get_gc = obj->handlers->get_gc) != NULL)) { int n; zval *zv, *end; @@ -964,9 +956,7 @@ tail_call: zend_object_get_gc_t get_gc; zend_object *obj = (zend_object*)ref; - ZEND_ASSERT(EG(objects_store).object_buckets != NULL); if (EXPECTED(!(GC_FLAGS(ref) & IS_OBJ_FREE_CALLED) && - IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle]) && (get_gc = obj->handlers->get_gc) != NULL)) { int n; zval *zv, *end; @@ -1122,11 +1112,12 @@ ZEND_API int zend_gc_collect_cycles(void) if (GC_TYPE(p) == IS_OBJECT) { zend_object *obj = (zend_object*)p; - if (IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle]) && - !(GC_FLAGS(obj) & IS_OBJ_DESTRUCTOR_CALLED)) { + if (!(GC_FLAGS(obj) & IS_OBJ_DESTRUCTOR_CALLED)) { GC_TRACE_REF(obj, "calling destructor"); GC_FLAGS(obj) |= IS_OBJ_DESTRUCTOR_CALLED; - if (obj->handlers->dtor_obj) { + if (obj->handlers->dtor_obj + && (obj->handlers->dtor_obj != zend_objects_destroy_object + || obj->ce->destructor)) { GC_REFCOUNT(obj)++; obj->handlers->dtor_obj(obj); GC_REFCOUNT(obj)--; @@ -1158,21 +1149,19 @@ ZEND_API int zend_gc_collect_cycles(void) if (GC_TYPE(p) == IS_OBJECT) { zend_object *obj = (zend_object*)p; - if (IS_OBJ_VALID(EG(objects_store).object_buckets[obj->handle])) { - EG(objects_store).object_buckets[obj->handle] = SET_OBJ_INVALID(obj); - GC_TYPE(obj) = IS_NULL; - if (!(GC_FLAGS(obj) & IS_OBJ_FREE_CALLED)) { - GC_FLAGS(obj) |= IS_OBJ_FREE_CALLED; - if (obj->handlers->free_obj) { - GC_REFCOUNT(obj)++; - obj->handlers->free_obj(obj); - GC_REFCOUNT(obj)--; - } + EG(objects_store).object_buckets[obj->handle] = SET_OBJ_INVALID(obj); + GC_TYPE(obj) = IS_NULL; + if (!(GC_FLAGS(obj) & IS_OBJ_FREE_CALLED)) { + GC_FLAGS(obj) |= IS_OBJ_FREE_CALLED; + if (obj->handlers->free_obj) { + GC_REFCOUNT(obj)++; + obj->handlers->free_obj(obj); + GC_REFCOUNT(obj)--; } - SET_OBJ_BUCKET_NUMBER(EG(objects_store).object_buckets[obj->handle], EG(objects_store).free_list_head); - EG(objects_store).free_list_head = obj->handle; - p = current->ref = (zend_refcounted*)(((char*)obj) - obj->handlers->offset); } + SET_OBJ_BUCKET_NUMBER(EG(objects_store).object_buckets[obj->handle], EG(objects_store).free_list_head); + EG(objects_store).free_list_head = obj->handle; + p = current->ref = (zend_refcounted*)(((char*)obj) - obj->handlers->offset); } else if (GC_TYPE(p) == IS_ARRAY) { zend_array *arr = (zend_array*)p;