mirror of
https://github.com/php/php-src.git
synced 2025-08-15 13:38:49 +02:00
Use zval_try_get_string_func() in concat_function() (#18815)
This allows a cheaper exception check and also does not need a release call. This shrinks concat_function() on x86-64 with GCC 15.1.1 from 3443 bytes to 3332 bytes.
This commit is contained in:
parent
5f9a0b568b
commit
8f3e5553f3
1 changed files with 4 additions and 6 deletions
|
@ -1989,9 +1989,8 @@ ZEND_API zend_result ZEND_FASTCALL concat_function(zval *result, zval *op1, zval
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_CONCAT);
|
ZEND_TRY_BINARY_OBJECT_OPERATION(ZEND_CONCAT);
|
||||||
op1_string = zval_get_string_func(op1);
|
op1_string = zval_try_get_string_func(op1);
|
||||||
if (UNEXPECTED(EG(exception))) {
|
if (UNEXPECTED(!op1_string)) {
|
||||||
zend_string_release(op1_string);
|
|
||||||
if (orig_op1 != result) {
|
if (orig_op1 != result) {
|
||||||
ZVAL_UNDEF(result);
|
ZVAL_UNDEF(result);
|
||||||
}
|
}
|
||||||
|
@ -2023,10 +2022,9 @@ ZEND_API zend_result ZEND_FASTCALL concat_function(zval *result, zval *op1, zval
|
||||||
free_op1_string = true;
|
free_op1_string = true;
|
||||||
}
|
}
|
||||||
ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_CONCAT);
|
ZEND_TRY_BINARY_OP2_OBJECT_OPERATION(ZEND_CONCAT);
|
||||||
op2_string = zval_get_string_func(op2);
|
op2_string = zval_try_get_string_func(op2);
|
||||||
if (UNEXPECTED(EG(exception))) {
|
if (UNEXPECTED(!op2_string)) {
|
||||||
zend_string_release(op1_string);
|
zend_string_release(op1_string);
|
||||||
zend_string_release(op2_string);
|
|
||||||
if (orig_op1 != result) {
|
if (orig_op1 != result) {
|
||||||
ZVAL_UNDEF(result);
|
ZVAL_UNDEF(result);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue