mirror of
https://github.com/php/php-src.git
synced 2025-01-24 04:33:39 +08:00
Removed deprecated checks.
This commit is contained in:
parent
908ce66f73
commit
c0be77aa75
@ -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? */
|
||||
|
||||
|
@ -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) {
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user