summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/opcache/jit/zend_jit.c12
-rw-r--r--ext/opcache/jit/zend_jit_x86.dasc2
2 files changed, 9 insertions, 5 deletions
diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c
index 9f03a11826..d360514f3f 100644
--- a/ext/opcache/jit/zend_jit.c
+++ b/ext/opcache/jit/zend_jit.c
@@ -1391,10 +1391,6 @@ static int zend_jit_try_allocate_free_reg(const zend_op_array *op_array, zend_ss
*/
available = ZEND_REGSET_DIFFERENCE(available, ZEND_REGSET_PRESERVED);
- if (ZEND_REGSET_IS_EMPTY(available)) {
- return 0;
- }
-
/* Set freeUntilPos of all physical registers to maxInt */
for (i = 0; i < ZREG_NUM; i++) {
freeUntilPos[i] = 0xffffffff;
@@ -1432,6 +1428,10 @@ static int zend_jit_try_allocate_free_reg(const zend_op_array *op_array, zend_ss
}
}
+ if (hint == ZREG_NONE && ZEND_REGSET_IS_EMPTY(available)) {
+ return 0;
+ }
+
/* See "Linear Scan Register Allocation on SSA Form", Christian Wimmer and
Michael Franz, CGO'10 (2010), Figure 6. */
if (current->flags & ZREG_SPLIT) {
@@ -1519,6 +1519,10 @@ static int zend_jit_try_allocate_free_reg(const zend_op_array *op_array, zend_ss
return 1;
}
+ if (ZEND_REGSET_IS_EMPTY(available)) {
+ return 0;
+ }
+
pos = 0; reg = ZREG_NONE;
pos2 = 0; reg2 = ZREG_NONE;
low_priority_regs = *hints;
diff --git a/ext/opcache/jit/zend_jit_x86.dasc b/ext/opcache/jit/zend_jit_x86.dasc
index bfc2c7e0f7..d6e1c27bbd 100644
--- a/ext/opcache/jit/zend_jit_x86.dasc
+++ b/ext/opcache/jit/zend_jit_x86.dasc
@@ -10947,7 +10947,7 @@ static zend_bool zend_jit_verify_return_type(dasm_State **Dst, const zend_op *op
static zend_bool zend_jit_may_reuse_reg(const zend_op *opline, const zend_ssa_op *ssa_op, zend_ssa *ssa, int def_var, int use_var)
{
- if (ssa->var_info[def_var].type != ssa->var_info[use_var].type) {
+ if ((ssa->var_info[def_var].type & ~MAY_BE_GUARD) != (ssa->var_info[use_var].type & ~MAY_BE_GUARD)) {
return 0;
}