Skip to content

Commit f8b1853

Browse files
committed
Tracing JIT: propagete op1 type info of FETCH_DIM_FETCH_ARG in read mode
1 parent af0a980 commit f8b1853

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5416,6 +5416,9 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
54165416
if (opline->op1_type == IS_CV
54175417
&& ssa->vars[ssa_op->op1_use].alias == NO_ALIAS) {
54185418
ssa->var_info[ssa_op->op1_use].guarded_reference = 1;
5419+
if (ssa_op->op1_def >= 0) {
5420+
ssa->var_info[ssa_op->op1_def].guarded_reference = 1;
5421+
}
54195422
}
54205423
} else {
54215424
CHECK_OP1_TRACE_TYPE();
@@ -5436,15 +5439,24 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
54365439
op1_info |= MAY_BE_PACKED_GUARD;
54375440
if (orig_op1_type & IS_TRACE_PACKED) {
54385441
op1_info &= ~(MAY_BE_ARRAY_NUMERIC_HASH|MAY_BE_ARRAY_STRING_HASH);
5442+
if (op1_type != IS_UNKNOWN) {
5443+
ssa->var_info[ssa_op->op1_use].type &= ~(MAY_BE_ARRAY_NUMERIC_HASH|MAY_BE_ARRAY_STRING_HASH);
5444+
}
54395445
} else {
54405446
op1_info &= ~MAY_BE_ARRAY_PACKED;
5447+
if (op1_type != IS_UNKNOWN) {
5448+
ssa->var_info[ssa_op->op1_use].type &= ~MAY_BE_ARRAY_PACKED;
5449+
}
54415450
}
54425451
}
54435452
if (!zend_jit_fetch_dim_read(&dasm_state, opline, ssa, ssa_op,
54445453
op1_info, op1_addr, avoid_refcounting,
54455454
op2_info, res_info, RES_REG_ADDR(), val_type)) {
54465455
goto jit_failure;
54475456
}
5457+
if (ssa_op->op1_def >= 0 && op1_type != IS_UNKNOWN) {
5458+
ssa->var_info[ssa_op->op1_def].type = ssa->var_info[ssa_op->op1_use].type;
5459+
}
54485460
goto done;
54495461
case ZEND_FETCH_DIM_W:
54505462
case ZEND_FETCH_DIM_RW:

0 commit comments

Comments
 (0)