summaryrefslogtreecommitdiff
path: root/Zend/zend_execute_API.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-05-07 16:28:23 +0300
committerDmitry Stogov <dmitry@zend.com>2015-05-07 16:28:23 +0300
commitab4ccffc4cceb877d2ce3144e5c499bd651886bf (patch)
treea1b9b371c5bc25f72d5358caf285a4f336d781f7 /Zend/zend_execute_API.c
parent62b1293e3df520d104c678bc520b413386b628c5 (diff)
downloadphp-git-ab4ccffc4cceb877d2ce3144e5c499bd651886bf.tar.gz
Avoid unnecessary reference counter incrementation on $this when call methods
Diffstat (limited to 'Zend/zend_execute_API.c')
-rw-r--r--Zend/zend_execute_API.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index ab32d9ad12..a7ab662c99 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -825,12 +825,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
if (func->common.fn_flags & ZEND_ACC_STATIC) {
fci->object = NULL;
}
- if (!fci->object) {
- Z_OBJ(call->This) = NULL;
- } else {
- Z_OBJ(call->This) = fci->object;
- GC_REFCOUNT(fci->object)++;
- }
+ Z_OBJ(call->This) = fci->object;
if (func->type == ZEND_USER_FUNCTION) {
int call_via_handler = (func->common.fn_flags & ZEND_ACC_CALL_VIA_TRAMPOLINE) != 0;
@@ -868,7 +863,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
}
EG(current_execute_data) = call->prev_execute_data;
zend_vm_stack_free_args(call);
- zend_vm_stack_free_call_frame(call);
/* We shouldn't fix bad extensions here,
because it can break proper ones (Bug #34045)
@@ -899,7 +893,6 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
}
zend_vm_stack_free_args(call);
- zend_vm_stack_free_call_frame(call);
if (func->type == ZEND_OVERLOADED_FUNCTION_TEMPORARY) {
zend_string_release(func->common.function_name);
@@ -912,11 +905,9 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
}
}
- if (fci->object) {
- OBJ_RELEASE(fci->object);
- }
-
EG(scope) = orig_scope;
+ 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;
}