Skip to content

Commit 166bc64

Browse files
committed
CAST to the same type mat be JIT-ed as QM_ASSIGN
1 parent a4d12f4 commit 166bc64

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,16 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
12491249
}
12501250
}
12511251
break;
1252+
case ZEND_CAST:
1253+
if (tssa->ops[idx].op1_use >= 0 && op1_type != IS_UNKNOWN) {
1254+
if (opline->extended_value == op1_type) {
1255+
zend_ssa_var_info *info = &ssa_var_info[ssa_ops[idx].op1_use];
1256+
if ((info->type & (MAY_BE_ANY|MAY_BE_UNDEF)) != (1 << op1_type)) {
1257+
info->type = MAY_BE_GUARD | zend_jit_trace_type_to_info_ex(op1_type, info->type);
1258+
}
1259+
}
1260+
}
1261+
break;
12521262
case ZEND_ASSIGN:
12531263
if (tssa->ops[idx].op2_use >= 0 && op2_type != IS_UNKNOWN) {
12541264
zend_ssa_var_info *info = &ssa_var_info[ssa_ops[idx].op2_use];
@@ -2136,6 +2146,11 @@ static const void *zend_jit_trace(zend_jit_trace_rec *trace_buffer, uint32_t par
21362146
goto jit_failure;
21372147
}
21382148
goto done;
2149+
case ZEND_CAST:
2150+
if (opline->extended_value != op1_type) {
2151+
break;
2152+
}
2153+
/* break missing intentionally */
21392154
case ZEND_QM_ASSIGN:
21402155
op1_addr = OP1_REG_ADDR();
21412156
if (ra

0 commit comments

Comments
 (0)