Skip to content

Commit

Permalink
Tracin JIT support for FETCH_DIM_W/RW with IS_VAR + IS_INDIRECT first…
Browse files Browse the repository at this point in the history
… operand.
  • Loading branch information
dstogov committed Sep 9, 2020
1 parent b553ba7 commit d6cc6b2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
18 changes: 16 additions & 2 deletions ext/opcache/jit/zend_jit_trace.c
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,9 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
case ZEND_FETCH_DIM_RW:
// case ZEND_FETCH_DIM_UNSET:
case ZEND_FETCH_LIST_W:
if (opline->op1_type != IS_CV) {
if (opline->op1_type != IS_CV
&& (orig_op1_type == IS_UNKNOWN
|| !(orig_op1_type & IS_TRACE_INDIRECT))) {
break;
}
ADD_OP1_TRACE_GUARD();
Expand Down Expand Up @@ -4325,11 +4327,23 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
case ZEND_FETCH_DIM_RW:
// case ZEND_FETCH_DIM_UNSET:
case ZEND_FETCH_LIST_W:
if (opline->op1_type != IS_CV) {
if (opline->op1_type != IS_CV
&& (orig_op1_type == IS_UNKNOWN
|| !(orig_op1_type & IS_TRACE_INDIRECT))) {
break;
}
op1_info = OP1_INFO();
op1_addr = OP1_REG_ADDR();
if (opline->op1_type == IS_VAR) {
if (orig_op1_type != IS_UNKNOWN
&& (orig_op1_type & IS_TRACE_INDIRECT)) {
if (!zend_jit_fetch_indirect_var(&dasm_state, opline, orig_op1_type, &op1_info, &op1_addr)) {
goto jit_failure;
}
} else {
break;
}
}
if (orig_op1_type != IS_UNKNOWN
&& (orig_op1_type & IS_TRACE_REFERENCE)) {
if (!zend_jit_fetch_reference(&dasm_state, opline, orig_op1_type, &op1_info, &op1_addr,
Expand Down
2 changes: 0 additions & 2 deletions ext/opcache/jit/zend_jit_x86.dasc
Original file line number Diff line number Diff line change
Expand Up @@ -10960,8 +10960,6 @@ static int zend_jit_fetch_dim(dasm_State **Dst,
{
zend_jit_addr op2_addr;

ZEND_ASSERT(opline->op1_type == IS_CV);

op2_addr = (opline->op2_type != IS_UNUSED) ? OP2_ADDR() : 0;

if (op1_info & MAY_BE_REF) {
Expand Down

0 comments on commit d6cc6b2

Please sign in to comment.