[php-src] jit-arm64: Updates for commits between 121a0f7 and 12dcf34
| From: | Hao Sun | Date: | Wed, 21 Apr 2021 06:22:58 +0000 |
| Subject: | [php-src] jit-arm64: Updates for commits between 121a0f7 and 12dcf34 | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-115719@lists.php.net to get a copy of this message | ||
Author: Hao Sun (shqking)
Date: 2021-04-21T06:22:17Z
Commit: https://github.com/php/php-src/commit/9c2aa6af3304ef4ac92b360d82dd23ef695e957f
Raw diff: https://github.com/php/php-src/commit/9c2aa6af3304ef4ac92b360d82dd23ef695e957f.diff
Updates for commits between 121a0f7 and 12dcf34
1. Pre-allocated bytes are missing in function
zend_jit_assign_const_stub().
2. 'w' register should be used for macro SET_ZVAL_TYPE_INFO.
3. 'w' register should be used to load "num_args" in function
zend_jit_do_fcall().
4. Remove the local path name in test case recv_002.phpt
5. One option is disabled temporarily in [1] and several test cases
would fail, e.g. shift_right_003.phpt. I suppose new execution paths are
touched. We will support them in the near future.
[1] https://github.com/php/php-src/commit/63d673d
Changed paths:
M ext/opcache/jit/zend_jit_arm64.dasc
M ext/opcache/tests/jit/recv_002.phpt
Diff:
diff --git a/ext/opcache/jit/zend_jit_arm64.dasc b/ext/opcache/jit/zend_jit_arm64.dasc
index 0bd83289e60b..33b0e850b075 100644
--- a/ext/opcache/jit/zend_jit_arm64.dasc
+++ b/ext/opcache/jit/zend_jit_arm64.dasc
@@ -907,17 +907,17 @@ static void* dasm_labels[zend_lb_MAX];
|| if (Z_MODE(dst_addr) == IS_MEM_ZVAL) {
|| if (dst_def_info == MAY_BE_DOUBLE) {
|| if ((dst_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_GUARD)) != MAY_BE_DOUBLE) {
-| SET_ZVAL_TYPE_INFO dst_addr, IS_DOUBLE, Rx(tmp_reg1), Rx(tmp_reg2)
+| SET_ZVAL_TYPE_INFO dst_addr, IS_DOUBLE, Rw(tmp_reg1), Rx(tmp_reg2)
|| }
|| } else if (((dst_info & (MAY_BE_ANY|MAY_BE_UNDEF|MAY_BE_GUARD)) != (1<<Z_TYPE_P(zv)))
|| (dst_info & (MAY_BE_STRING|MAY_BE_ARRAY)) != 0) {
-| SET_ZVAL_TYPE_INFO dst_addr, Z_TYPE_INFO_P(zv), Rx(tmp_reg1), Rx(tmp_reg2)
+| SET_ZVAL_TYPE_INFO dst_addr, Z_TYPE_INFO_P(zv), Rw(tmp_reg1), Rx(tmp_reg2)
|| }
|| }
|| if (Z_MODE(res_addr) == IS_MEM_ZVAL) {
|| if (dst_def_info == MAY_BE_DOUBLE) {
-| SET_ZVAL_TYPE_INFO res_addr, IS_DOUBLE, Rx(tmp_reg1), Rx(tmp_reg2)
+| SET_ZVAL_TYPE_INFO res_addr, IS_DOUBLE, Rw(tmp_reg1), Rx(tmp_reg2)
|| } else {
-| SET_ZVAL_TYPE_INFO res_addr, Z_TYPE_INFO_P(zv), Rx(tmp_reg1), Rx(tmp_reg2)
+| SET_ZVAL_TYPE_INFO res_addr, Z_TYPE_INFO_P(zv), Rw(tmp_reg1), Rx(tmp_reg2)
|| }
|| }
|.endmacro
@@ -2111,6 +2111,7 @@ static int zend_jit_assign_const_stub(dasm_State **Dst)
uint32_t val_info = MAY_BE_ANY|MAY_BE_RC1|MAY_BE_RCN;
|->assign_const:
+ | sub sp, sp, #16
if (!zend_jit_assign_to_variable(
Dst, NULL,
var_addr, var_addr, -1, -1,
@@ -2118,6 +2119,7 @@ static int zend_jit_assign_const_stub(dasm_State **Dst)
0, 0)) {
return 0;
}
+ | add sp, sp, #16
| ret
return 1;
}
@@ -7105,7 +7107,7 @@ static int zend_jit_do_fcall(dasm_State **Dst, const zend_op *opline, const
zend
if (!func) {
| ldr REG0, EX->func // reload
}
- | ldr REG1, [FP, #offsetof(zend_execute_data, This.u2.num_args)] // reload
+ | ldr REG1w, [FP, #offsetof(zend_execute_data, This.u2.num_args)] // reload
| b >1
|.code
if (!func || (func->op_array.fn_flags & ZEND_ACC_HAS_TYPE_HINTS) == 0) {
@@ -8678,12 +8680,11 @@ static int zend_jit_recv_init(dasm_State **Dst, const zend_op *opline, const
zen
| ldr REG0, EX->func
| ldr FCARG2x, [REG0, #offsetof(zend_op_array, scope)]
| EXT_CALL zval_update_constant_ex, REG0
- | tst RETVALw, RETVALw
- | bne >1
+ | cbnz RETVALw, >1
|.cold_code
|1:
| ZVAL_PTR_DTOR res_addr, MAY_BE_ANY|MAY_BE_RC1|MAY_BE_RCN, 1, 0, opline, ZREG_TMP1, ZREG_TMP2
- | SET_ZVAL_TYPE_INFO res_addr, IS_UNDEF, TMP1, TMP2
+ | SET_ZVAL_TYPE_INFO res_addr, IS_UNDEF, TMP1w, TMP2
| b ->exception_handler
|.code
}
diff --git a/ext/opcache/tests/jit/recv_002.phpt b/ext/opcache/tests/jit/recv_002.phpt
index 5e2951a97e2b..0f38edc4400e 100644
--- a/ext/opcache/tests/jit/recv_002.phpt
+++ b/ext/opcache/tests/jit/recv_002.phpt
@@ -20,7 +20,7 @@ test();
?>
--EXPECTF--
-Fatal error: Uncaught ArgumentCountError: Too few arguments to function test(), 0 passed in
/home/dmitry/php/php-arm64/ext/opcache/tests/jit/recv_002.php on line 7 and exactly 1 expected in
%s:3
+Fatal error: Uncaught ArgumentCountError: Too few arguments to function test(), 0 passed in
%srecv_002.php on line 7 and exactly 1 expected in %s:3
Stack trace:
#0 %s(7): test()
#1 {main}