summaryrefslogtreecommitdiff
path: root/Zend/zend_vm_execute.h
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-08-24 12:47:06 +0300
committerDmitry Stogov <dmitry@zend.com>2015-08-24 12:47:06 +0300
commitdb5898c9e55b33c9378295a8a85aa863202996bc (patch)
treea846b02bbac6b8e93fbe97e0fa188659eba2d1a4 /Zend/zend_vm_execute.h
parentb928ea2de72f73687a4f55251ce68c9a96c8574a (diff)
downloadphp-git-db5898c9e55b33c9378295a8a85aa863202996bc.tar.gz
Optimize fast path
Diffstat (limited to 'Zend/zend_vm_execute.h')
-rw-r--r--Zend/zend_vm_execute.h26
1 files changed, 18 insertions, 8 deletions
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index 3f54a01e8b..fef3e96bc7 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -32798,20 +32798,30 @@ check_indirect:
}
}
- variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
-
do {
zend_reference *ref;
if (UNEXPECTED(!Z_ISREF_P(value))) {
- ZVAL_NEW_REF(value, value);
- } else if (UNEXPECTED(variable_ptr == value)) {
- break;
+ ref = (zend_reference*)emalloc(sizeof(zend_reference));
+ GC_REFCOUNT(ref) = 2;
+ GC_TYPE_INFO(ref) = IS_REFERENCE;
+ ZVAL_COPY_VALUE(&ref->val, value);
+ Z_REF_P(value) = ref;
+ Z_TYPE_INFO_P(value) = IS_REFERENCE_EX;
+ } else {
+ ref = Z_REF_P(value);
+ GC_REFCOUNT(ref)++;
}
- ref = Z_REF_P(value);
- GC_REFCOUNT(ref)++;
+
+ variable_ptr = _get_zval_ptr_cv_undef_BP_VAR_W(execute_data, opline->op1.var);
+
if (UNEXPECTED(Z_REFCOUNTED_P(variable_ptr))) {
- if (!Z_DELREF_P(variable_ptr)) {
+ uint32_t refcnt = Z_DELREF_P(variable_ptr);
+
+ if (UNEXPECTED(variable_ptr == value)) {
+ break;
+ }
+ if (refcnt == 0) {
SAVE_OPLINE();
zval_dtor_func_for_ptr(Z_COUNTED_P(variable_ptr));
if (UNEXPECTED(EG(exception))) {