com php-src: Removed deprecated checks.: Zend/zend_API.c Zend/zend_execute_API.c Zend/zend_gc.c
| From: | Dmitry Stogov | Date: | Tue, 27 Jun 2017 10:12:09 +0000 |
| Subject: | com php-src: Removed deprecated checks.: Zend/zend_API.c Zend/zend_execute_API.c Zend/zend_gc.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-98232@lists.php.net to get a copy of this message | ||
Commit: c0be77aa75f4c8d926eb4979f4b6213dfd0b3a0a
Author: Dmitry Stogov <dmitry@zend.com> Tue, 27 Jun 2017 13:12:09 +0300
Parents: 908ce66f73f78870b1159697a4276e273c767fa3
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=c0be77aa75f4c8d926eb4979f4b6213dfd0b3a0a
Log:
Removed deprecated checks.
Changed paths:
M Zend/zend_API.c
M Zend/zend_execute_API.c
M Zend/zend_gc.c
Diff:
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index bf2619e..2a0fafb 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 5e02b78..77345c4 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 31bec4c..d8757d0 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;