Skip to content

Commit

Permalink
JIT: Fix register clobbering
Browse files Browse the repository at this point in the history
  • Loading branch information
dstogov committed Feb 28, 2022
1 parent 33cd61c commit 8b8cf8f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
20 changes: 10 additions & 10 deletions ext/opcache/jit/zend_jit_arm64.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -3816,15 +3816,15 @@ static int zend_jit_inc_dec(dasm_State **Dst, const zend_op *opline, uint32_t op
| LOAD_64BIT_VAL TMP1, val
| fmov Rd(Z_REG(op1_def_addr)-ZREG_V0), TMP1
} else {
| SET_ZVAL_LVAL op1_def_addr, val, REG0, TMP1
| SET_ZVAL_LVAL op1_def_addr, val, TMP2, TMP1
}
} else {
uint64_t val = 0xc3e0000000000000;
if (Z_MODE(op1_def_addr) == IS_REG) {
| LOAD_64BIT_VAL TMP1, val
| fmov Rd(Z_REG(op1_def_addr)-ZREG_V0), TMP1
} else {
| SET_ZVAL_LVAL op1_def_addr, val, REG0, TMP1
| SET_ZVAL_LVAL op1_def_addr, val, TMP2, TMP1
}
}
if (Z_MODE(op1_def_addr) == IS_MEM_ZVAL) {
Expand Down Expand Up @@ -4155,7 +4155,7 @@ static int zend_jit_math_long_long(dasm_State **Dst,
| LOAD_64BIT_VAL TMP1, val
| fmov Rd(Z_REG(res_addr)-ZREG_V0), TMP1
} else {
| SET_ZVAL_LVAL res_addr, val, REG0, TMP1
| SET_ZVAL_LVAL res_addr, val, TMP2, TMP1
}
break;
} else if (opcode == ZEND_SUB) {
Expand All @@ -4164,7 +4164,7 @@ static int zend_jit_math_long_long(dasm_State **Dst,
| LOAD_64BIT_VAL TMP1, val
| fmov Rd(Z_REG(res_addr)-ZREG_V0), TMP1
} else {
| SET_ZVAL_LVAL res_addr, val, REG0, TMP1
| SET_ZVAL_LVAL res_addr, val, TMP2, TMP1
}
break;
}
Expand Down Expand Up @@ -12942,20 +12942,20 @@ static int zend_jit_incdec_obj(dasm_State **Dst,
|3:
if (opline->opcode == ZEND_PRE_INC_OBJ || opline->opcode == ZEND_POST_INC_OBJ) {
uint64_t val = 0x43e0000000000000;
| LOAD_64BIT_VAL REG0, val
| SET_ZVAL_LVAL_FROM_REG var_addr, REG0, TMP1
| LOAD_64BIT_VAL TMP2, val
| SET_ZVAL_LVAL_FROM_REG var_addr, TMP2, TMP1
| SET_ZVAL_TYPE_INFO var_addr, IS_DOUBLE, TMP1w, TMP2
if (opline->opcode == ZEND_PRE_INC_OBJ && opline->result_type != IS_UNUSED) {
| SET_ZVAL_LVAL_FROM_REG res_addr, REG0, TMP1
| SET_ZVAL_LVAL_FROM_REG res_addr, TMP2, TMP1
| SET_ZVAL_TYPE_INFO res_addr, IS_DOUBLE, TMP1w, TMP2
}
} else {
uint64_t val = 0xc3e0000000000000;
| LOAD_64BIT_VAL REG0, val
| SET_ZVAL_LVAL_FROM_REG var_addr, REG0, TMP1
| LOAD_64BIT_VAL TMP2, val
| SET_ZVAL_LVAL_FROM_REG var_addr, TMP2, TMP1
| SET_ZVAL_TYPE_INFO var_addr, IS_DOUBLE, TMP1w, TMP2
if (opline->opcode == ZEND_PRE_DEC_OBJ && opline->result_type != IS_UNUSED) {
| SET_ZVAL_LVAL_FROM_REG res_addr, REG0, TMP1
| SET_ZVAL_LVAL_FROM_REG res_addr, TMP2, TMP1
| SET_ZVAL_TYPE_INFO res_addr, IS_DOUBLE, TMP1w, TMP2
}
}
Expand Down
2 changes: 0 additions & 2 deletions ext/opcache/tests/jit/assign_dim_op_007.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ opcache.enable=1
opcache.enable_cli=1
opcache.file_update_protection=0
opcache.jit_buffer_size=1M
--XFAIL--
See https://github.com/php/php-src/issues/8147
--FILE--
<?php
class test {
Expand Down

0 comments on commit 8b8cf8f

Please sign in to comment.