summaryrefslogtreecommitdiff
path: root/Zend/zend_variables.h
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-06-03 03:54:03 +0400
committerDmitry Stogov <dmitry@zend.com>2014-06-03 03:54:03 +0400
commit30c05577f76a756a83b48b7bd422439da0bdcafb (patch)
tree88a244453af17a312f5acc4b098ea8afb103466d /Zend/zend_variables.h
parentaf78ea1d9781edd0e733be63d0b2033a8c445da7 (diff)
downloadphp-git-30c05577f76a756a83b48b7bd422439da0bdcafb.tar.gz
Optimized conditions order
Diffstat (limited to 'Zend/zend_variables.h')
-rw-r--r--Zend/zend_variables.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/Zend/zend_variables.h b/Zend/zend_variables.h
index 282725a325..c55ce233a5 100644
--- a/Zend/zend_variables.h
+++ b/Zend/zend_variables.h
@@ -62,6 +62,28 @@ static zend_always_inline void _zval_opt_copy_ctor(zval *zvalue ZEND_FILE_LINE_D
}
}
+static zend_always_inline void _zval_copy_ctor_no_imm(zval *zvalue ZEND_FILE_LINE_DC)
+{
+ if (Z_REFCOUNTED_P(zvalue)) {
+ if (Z_COPYABLE_P(zvalue)) {
+ _zval_copy_ctor_func(zvalue ZEND_FILE_LINE_RELAY_CC);
+ } else {
+ Z_ADDREF_P(zvalue);
+ }
+ }
+}
+
+static zend_always_inline void _zval_opt_copy_ctor_no_imm(zval *zvalue ZEND_FILE_LINE_DC)
+{
+ if (Z_OPT_REFCOUNTED_P(zvalue)) {
+ if (Z_OPT_COPYABLE_P(zvalue)) {
+ _zval_copy_ctor_func(zvalue ZEND_FILE_LINE_RELAY_CC);
+ } else {
+ Z_ADDREF_P(zvalue);
+ }
+ }
+}
+
ZEND_API int zval_copy_static_var(zval *p TSRMLS_DC, int num_args, va_list args, zend_hash_key *key);
ZEND_API int zend_print_variable(zval *var TSRMLS_DC);
@@ -72,6 +94,8 @@ ZEND_API void _zval_internal_ptr_dtor(zval *zvalue ZEND_FILE_LINE_DC);
ZEND_API void _zval_dtor_wrapper(zval *zvalue);
#define zval_copy_ctor(zvalue) _zval_copy_ctor((zvalue) ZEND_FILE_LINE_CC)
#define zval_opt_copy_ctor(zvalue) _zval_opt_copy_ctor((zvalue) ZEND_FILE_LINE_CC)
+#define zval_copy_ctor_no_imm(zvalue) _zval_copy_ctor_no_imm((zvalue) ZEND_FILE_LINE_CC)
+#define zval_opt_copy_ctor_no_imm(zvalue) _zval_opt_copy_ctor_no_imm((zvalue) ZEND_FILE_LINE_CC)
#define zval_dtor(zvalue) _zval_dtor((zvalue) ZEND_FILE_LINE_CC)
#define zval_ptr_dtor(zval_ptr) _zval_ptr_dtor((zval_ptr) ZEND_FILE_LINE_CC)
#define zval_internal_dtor(zvalue) _zval_internal_dtor((zvalue) ZEND_FILE_LINE_CC)