Skip to content

Commit 0c56d0d

Browse files
committed
Revert JIT changes
No longer necessary since disabling QM_ASSIGN optimization for ZEND_NEW
1 parent 7fa98fd commit 0c56d0d

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

ext/opcache/jit/zend_jit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2845,7 +2845,7 @@ static int zend_jit(const zend_op_array *op_array, zend_ssa *ssa, const zend_op
28452845
const zend_op *next_opline = opline + 1;
28462846

28472847
ZEND_ASSERT(b + 1 == ssa->cfg.blocks[b].successors[0]);
2848-
zend_jit_constructor(&ctx, next_opline, op_array, ssa, call_level, b, b + 1);
2848+
zend_jit_constructor(&ctx, next_opline, op_array, ssa, call_level, b + 1);
28492849
}
28502850

28512851
/* We skip over the DO_FCALL, so decrement call_level ourselves. */

ext/opcache/jit/zend_jit_ir.c

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10728,7 +10728,7 @@ static int zend_jit_do_fcall(zend_jit_ctx *jit, const zend_op *opline, const zen
1072810728
return 1;
1072910729
}
1073010730

10731-
static int zend_jit_constructor(zend_jit_ctx *jit, const zend_op *opline, const zend_op_array *op_array, zend_ssa *ssa, int call_level, int b, int next_block)
10731+
static int zend_jit_constructor(zend_jit_ctx *jit, const zend_op *opline, const zend_op_array *op_array, zend_ssa *ssa, int call_level, int next_block)
1073210732
{
1073310733
ir_ref if_skip_constructor = jit_IF_ex(jit, jit_CMP_IP(jit, IR_NE, opline), next_block);
1073410734

@@ -10744,12 +10744,21 @@ static int zend_jit_constructor(zend_jit_ctx *jit, const zend_op *opline, const
1074410744
}
1074510745
}
1074610746

10747-
/* merge current control path with the true branch of constructor skip condition */
10748-
ZEND_ASSERT(jit->ctx.control);
10749-
ir_MERGE_WITH_EMPTY_TRUE(if_skip_constructor);
10750-
_zend_jit_add_predecessor_ref(jit, next_block, b, ir_END());
10747+
/* override predecessors of the next block */
10748+
ZEND_ASSERT(jit->ssa->cfg.blocks[next_block].predecessors_count == 1);
10749+
if (!jit->ctx.control) {
10750+
ZEND_ASSERT(jit->bb_edges[jit->bb_predecessors[next_block]]);
10751+
ir_IF_TRUE(if_skip_constructor);
10752+
ir_MERGE_2(jit->bb_edges[jit->bb_predecessors[next_block]], ir_END());
10753+
jit->bb_edges[jit->bb_predecessors[next_block]] = ir_END();
10754+
} else {
10755+
ZEND_ASSERT(!jit->bb_edges[jit->bb_predecessors[next_block]]);
10756+
/* merge current control path with the true branch of constructor skip condition */
10757+
ir_MERGE_WITH_EMPTY_TRUE(if_skip_constructor);
10758+
jit->bb_edges[jit->bb_predecessors[next_block]] = ir_END();
1075110759

10752-
jit->b = -1;
10760+
jit->b = -1;
10761+
}
1075310762

1075410763
return 1;
1075510764
}

0 commit comments

Comments
 (0)