@@ -1662,92 +1662,88 @@ ZEND_API int ZEND_FASTCALL concat_function(zval *result, zval *op1, zval *op2) /
1662
1662
}
1663
1663
/* }}} */
1664
1664
1665
- ZEND_API int string_compare_function_ex (zval * result , zval * op1 , zval * op2 , zend_bool case_insensitive ) /* {{{ */
1665
+ ZEND_API int ZEND_FASTCALL string_compare_function_ex (zval * op1 , zval * op2 , zend_bool case_insensitive ) /* {{{ */
1666
1666
{
1667
1667
zend_string * str1 = zval_get_string (op1 );
1668
1668
zend_string * str2 = zval_get_string (op2 );
1669
+ int ret ;
1669
1670
1670
1671
if (case_insensitive ) {
1671
- ZVAL_LONG ( result , zend_binary_strcasecmp_l (ZSTR_VAL (str1 ), ZSTR_LEN (str1 ), ZSTR_VAL (str2 ), ZSTR_LEN (str1 ) ));
1672
+ ret = zend_binary_strcasecmp_l (ZSTR_VAL (str1 ), ZSTR_LEN (str1 ), ZSTR_VAL (str2 ), ZSTR_LEN (str1 ));
1672
1673
} else {
1673
- ZVAL_LONG ( result , zend_binary_strcmp (ZSTR_VAL (str1 ), ZSTR_LEN (str1 ), ZSTR_VAL (str2 ), ZSTR_LEN (str2 ) ));
1674
+ ret = zend_binary_strcmp (ZSTR_VAL (str1 ), ZSTR_LEN (str1 ), ZSTR_VAL (str2 ), ZSTR_LEN (str2 ));
1674
1675
}
1675
1676
1676
1677
zend_string_release (str1 );
1677
1678
zend_string_release (str2 );
1678
- return SUCCESS ;
1679
+ return ret ;
1679
1680
}
1680
1681
/* }}} */
1681
1682
1682
- ZEND_API int string_compare_function (zval * result , zval * op1 , zval * op2 ) /* {{{ */
1683
+ ZEND_API int ZEND_FASTCALL string_compare_function (zval * op1 , zval * op2 ) /* {{{ */
1683
1684
{
1684
1685
if (EXPECTED (Z_TYPE_P (op1 ) == IS_STRING ) &&
1685
1686
EXPECTED (Z_TYPE_P (op2 ) == IS_STRING )) {
1686
1687
if (Z_STR_P (op1 ) == Z_STR_P (op2 )) {
1687
- ZVAL_LONG ( result , 0 ) ;
1688
+ return 0 ;
1688
1689
} else {
1689
- ZVAL_LONG ( result , zend_binary_strcmp (Z_STRVAL_P (op1 ), Z_STRLEN_P (op1 ), Z_STRVAL_P (op2 ), Z_STRLEN_P (op2 ) ));
1690
+ return zend_binary_strcmp (Z_STRVAL_P (op1 ), Z_STRLEN_P (op1 ), Z_STRVAL_P (op2 ), Z_STRLEN_P (op2 ));
1690
1691
}
1691
1692
} else {
1692
1693
zend_string * str1 = zval_get_string (op1 );
1693
1694
zend_string * str2 = zval_get_string (op2 );
1694
-
1695
- ZVAL_LONG (result , zend_binary_strcmp (ZSTR_VAL (str1 ), ZSTR_LEN (str1 ), ZSTR_VAL (str2 ), ZSTR_LEN (str2 )));
1695
+ int ret = zend_binary_strcmp (ZSTR_VAL (str1 ), ZSTR_LEN (str1 ), ZSTR_VAL (str2 ), ZSTR_LEN (str2 ));
1696
1696
1697
1697
zend_string_release (str1 );
1698
1698
zend_string_release (str2 );
1699
+ return ret ;
1699
1700
}
1700
- return SUCCESS ;
1701
1701
}
1702
1702
/* }}} */
1703
1703
1704
- ZEND_API int string_case_compare_function (zval * result , zval * op1 , zval * op2 ) /* {{{ */
1704
+ ZEND_API int ZEND_FASTCALL string_case_compare_function (zval * op1 , zval * op2 ) /* {{{ */
1705
1705
{
1706
1706
if (EXPECTED (Z_TYPE_P (op1 ) == IS_STRING ) &&
1707
1707
EXPECTED (Z_TYPE_P (op2 ) == IS_STRING )) {
1708
1708
if (Z_STR_P (op1 ) == Z_STR_P (op2 )) {
1709
- ZVAL_LONG ( result , 0 ) ;
1709
+ return 0 ;
1710
1710
} else {
1711
- ZVAL_LONG ( result , zend_binary_strcasecmp_l (Z_STRVAL_P (op1 ), Z_STRLEN_P (op1 ), Z_STRVAL_P (op2 ), Z_STRLEN_P (op2 ) ));
1711
+ return zend_binary_strcasecmp_l (Z_STRVAL_P (op1 ), Z_STRLEN_P (op1 ), Z_STRVAL_P (op2 ), Z_STRLEN_P (op2 ));
1712
1712
}
1713
1713
} else {
1714
1714
zend_string * str1 = zval_get_string (op1 );
1715
1715
zend_string * str2 = zval_get_string (op2 );
1716
-
1717
- ZVAL_LONG (result , zend_binary_strcasecmp_l (ZSTR_VAL (str1 ), ZSTR_LEN (str1 ), ZSTR_VAL (str2 ), ZSTR_LEN (str1 )));
1716
+ int ret = zend_binary_strcasecmp_l (ZSTR_VAL (str1 ), ZSTR_LEN (str1 ), ZSTR_VAL (str2 ), ZSTR_LEN (str1 ));
1718
1717
1719
1718
zend_string_release (str1 );
1720
1719
zend_string_release (str2 );
1720
+ return ret ;
1721
1721
}
1722
- return SUCCESS ;
1723
1722
}
1724
1723
/* }}} */
1725
1724
1726
1725
#if HAVE_STRCOLL
1727
- ZEND_API int string_locale_compare_function (zval * result , zval * op1 , zval * op2 ) /* {{{ */
1726
+ ZEND_API int ZEND_FASTCALL string_locale_compare_function (zval * op1 , zval * op2 ) /* {{{ */
1728
1727
{
1729
1728
zend_string * str1 = zval_get_string (op1 );
1730
1729
zend_string * str2 = zval_get_string (op2 );
1731
-
1732
- ZVAL_LONG (result , strcoll (ZSTR_VAL (str1 ), ZSTR_VAL (str2 )));
1730
+ int ret = strcoll (ZSTR_VAL (str1 ), ZSTR_VAL (str2 ));
1733
1731
1734
1732
zend_string_release (str1 );
1735
1733
zend_string_release (str2 );
1736
- return SUCCESS ;
1734
+ return ret ;
1737
1735
}
1738
1736
/* }}} */
1739
1737
#endif
1740
1738
1741
- ZEND_API int numeric_compare_function (zval * result , zval * op1 , zval * op2 ) /* {{{ */
1739
+ ZEND_API int ZEND_FASTCALL numeric_compare_function (zval * op1 , zval * op2 ) /* {{{ */
1742
1740
{
1743
1741
double d1 , d2 ;
1744
1742
1745
1743
d1 = zval_get_double (op1 );
1746
1744
d2 = zval_get_double (op2 );
1747
1745
1748
- ZVAL_LONG (result , ZEND_NORMALIZE_BOOL (d1 - d2 ));
1749
-
1750
- return SUCCESS ;
1746
+ return ZEND_NORMALIZE_BOOL (d1 - d2 );
1751
1747
}
1752
1748
/* }}} */
1753
1749
@@ -1763,7 +1759,7 @@ static inline void zend_free_obj_get_result(zval *op) /* {{{ */
1763
1759
}
1764
1760
/* }}} */
1765
1761
1766
- static int ZEND_FASTCALL convert_compare_result_to_long (zval * result )
1762
+ static void ZEND_FASTCALL convert_compare_result_to_long (zval * result )
1767
1763
{
1768
1764
if (Z_TYPE_P (result ) == IS_DOUBLE ) {
1769
1765
ZVAL_LONG (result , ZEND_NORMALIZE_BOOL (Z_DVAL_P (result )));
@@ -1829,7 +1825,7 @@ ZEND_API int ZEND_FASTCALL compare_function(zval *result, zval *op1, zval *op2)
1829
1825
ZVAL_LONG (result , 0 );
1830
1826
return SUCCESS ;
1831
1827
}
1832
- ZVAL_LONG (result , zendi_smart_strcmp (op1 , op2 ));
1828
+ ZVAL_LONG (result , zendi_smart_strcmp (Z_STR_P ( op1 ), Z_STR_P ( op2 ) ));
1833
1829
return SUCCESS ;
1834
1830
1835
1831
case TYPE_PAIR (IS_NULL , IS_STRING ):
@@ -1962,15 +1958,6 @@ ZEND_API int ZEND_FASTCALL compare_function(zval *result, zval *op1, zval *op2)
1962
1958
}
1963
1959
/* }}} */
1964
1960
1965
- ZEND_API int zval_compare_function (zval * result , zval * op1 , zval * op2 ) /* {{{ */
1966
- {
1967
- int ret = compare_function (result , op1 , op2 );
1968
-
1969
- ZEND_ASSERT (Z_TYPE_P (result ) == IS_LONG );
1970
- return ret ;
1971
- }
1972
- /* }}} */
1973
-
1974
1961
static int hash_zval_identical_function (zval * z1 , zval * z2 ) /* {{{ */
1975
1962
{
1976
1963
zval result ;
@@ -2644,15 +2631,15 @@ ZEND_API int ZEND_FASTCALL zend_binary_zval_strncasecmp(zval *s1, zval *s2, zval
2644
2631
}
2645
2632
/* }}} */
2646
2633
2647
- ZEND_API zend_long ZEND_FASTCALL zendi_smart_strcmp (zval * s1 , zval * s2 ) /* {{{ */
2634
+ ZEND_API zend_long ZEND_FASTCALL zendi_smart_strcmp (zend_string * s1 , zend_string * s2 ) /* {{{ */
2648
2635
{
2649
2636
int ret1 , ret2 ;
2650
2637
int oflow1 , oflow2 ;
2651
2638
zend_long lval1 = 0 , lval2 = 0 ;
2652
2639
double dval1 = 0.0 , dval2 = 0.0 ;
2653
2640
2654
- if ((ret1 = is_numeric_string_ex (Z_STRVAL_P ( s1 ), Z_STRLEN_P ( s1 ) , & lval1 , & dval1 , 0 , & oflow1 )) &&
2655
- (ret2 = is_numeric_string_ex (Z_STRVAL_P ( s2 ), Z_STRLEN_P ( s2 ) , & lval2 , & dval2 , 0 , & oflow2 ))) {
2641
+ if ((ret1 = is_numeric_string_ex (s1 -> val , s1 -> len , & lval1 , & dval1 , 0 , & oflow1 )) &&
2642
+ (ret2 = is_numeric_string_ex (s2 -> val , s2 -> len , & lval2 , & dval2 , 0 , & oflow2 ))) {
2656
2643
#if ZEND_ULONG_MAX == 0xFFFFFFFF
2657
2644
if (oflow1 != 0 && oflow1 == oflow2 && dval1 - dval2 == 0. &&
2658
2645
((oflow1 == 1 && dval1 > 9007199254740991. /*0x1FFFFFFFFFFFFF*/ )
@@ -2689,7 +2676,7 @@ ZEND_API zend_long ZEND_FASTCALL zendi_smart_strcmp(zval *s1, zval *s2) /* {{{ *
2689
2676
} else {
2690
2677
int strcmp_ret ;
2691
2678
string_cmp :
2692
- strcmp_ret = zend_binary_strcmp (Z_STRVAL_P ( s1 ), Z_STRLEN_P ( s1 ), Z_STRVAL_P ( s2 ), Z_STRLEN_P ( s2 ) );
2679
+ strcmp_ret = zend_binary_strcmp (s1 -> val , s1 -> len , s2 -> val , s2 -> len );
2693
2680
return ZEND_NORMALIZE_BOOL (strcmp_ret );
2694
2681
}
2695
2682
}
0 commit comments