From d880ead8a733202be2f74228339390e81ab824b5 Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Wed, 29 Apr 2015 16:43:23 +0300 Subject: Improve fast_is_[not_]identical() functions to teturn value instead of takeing additional arguments. Pair INSTANCEOF with the following JMPZ/JMPNZ. --- Zend/zend_operators.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'Zend/zend_operators.h') diff --git a/Zend/zend_operators.h b/Zend/zend_operators.h index 2625cda27f..5e16bf87f4 100644 --- a/Zend/zend_operators.h +++ b/Zend/zend_operators.h @@ -60,6 +60,8 @@ ZEND_API int ZEND_FASTCALL shift_left_function(zval *result, zval *op1, zval *op ZEND_API int ZEND_FASTCALL shift_right_function(zval *result, zval *op1, zval *op2); ZEND_API int ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2); +ZEND_API int ZEND_FASTCALL zend_is_identical(zval *op1, zval *op2); + ZEND_API int ZEND_FASTCALL is_equal_function(zval *result, zval *op1, zval *op2); ZEND_API int ZEND_FASTCALL is_identical_function(zval *result, zval *op1, zval *op2); ZEND_API int ZEND_FASTCALL is_not_identical_function(zval *result, zval *op1, zval *op2); @@ -842,23 +844,20 @@ static zend_always_inline int fast_equal_check_string(zval *op1, zval *op2) return Z_LVAL(result) == 0; } -static zend_always_inline void fast_is_identical_function(zval *result, zval *op1, zval *op2) +static zend_always_inline int fast_is_identical_function(zval *op1, zval *op2) { if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) { - ZVAL_FALSE(result); - return; + return 0; } - is_identical_function(result, op1, op2); + return zend_is_identical(op1, op2); } -static zend_always_inline void fast_is_not_identical_function(zval *result, zval *op1, zval *op2) +static zend_always_inline int fast_is_not_identical_function(zval *op1, zval *op2) { if (Z_TYPE_P(op1) != Z_TYPE_P(op2)) { - ZVAL_TRUE(result); - return; + return 1; } - is_identical_function(result, op1, op2); - ZVAL_BOOL(result, Z_TYPE_P(result) != IS_TRUE); + return !zend_is_identical(op1, op2); } #define ZEND_TRY_BINARY_OP1_OBJECT_OPERATION(opcode, binary_op) \ -- cgit v1.2.1