Skip to content

Commit 29bef78

Browse files
committed
Use _const_op_type() for converting constant into type info
1 parent 1ba6e66 commit 29bef78

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

ext/opcache/jit/zend_jit_trace.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
12761276
uint32_t info;
12771277

12781278
if (opline->op1_type == IS_CONST) {
1279-
info = zend_jit_trace_type_to_info(Z_TYPE_P(RT_CONSTANT(opline, opline->op1)));
1279+
info = _const_op_type(RT_CONSTANT(opline, opline->op1));
12801280
} else {
12811281
ZEND_ASSERT(ssa_ops[idx].op1_use >= 0);
12821282
info = ssa_var_info[ssa_ops[idx].op1_use].type & ~MAY_BE_GUARD;
@@ -1314,7 +1314,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
13141314
if (opline->op1_type == IS_UNUSED) {
13151315
return_value_info.type = MAY_BE_NULL;
13161316
} else if (opline->op1_type == IS_CONST) {
1317-
return_value_info.type = zend_jit_trace_type_to_info(Z_TYPE_P(RT_CONSTANT(opline, opline->op1)));
1317+
return_value_info.type = _const_op_type(RT_CONSTANT(opline, opline->op1));
13181318
} else {
13191319
ZEND_ASSERT(ssa_ops[idx].op1_use >= 0);
13201320
return_value_info = ssa_var_info[ssa_ops[idx].op1_use];
@@ -1351,7 +1351,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
13511351
if (opline->opcode == ZEND_RECV_INIT
13521352
&& !(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
13531353
/* RECV_INIT always copy the constant */
1354-
ssa_var_info[ssa_ops[idx].result_def].type = zend_jit_trace_type_to_info(Z_TYPE_P(RT_CONSTANT(opline, opline->op2)));
1354+
ssa_var_info[ssa_ops[idx].result_def].type = _const_op_type(RT_CONSTANT(opline, opline->op2));
13551355
} else {
13561356
if (zend_update_type_info(op_array, tssa, script, (zend_op*)opline, ssa_ops + idx, ssa_opcodes, optimization_level) == FAILURE) {
13571357
// TODO:
@@ -1405,7 +1405,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin
14051405
if (opline->opcode == ZEND_RECV_INIT
14061406
&& !(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
14071407
/* RECV_INIT always copy the constant */
1408-
ssa_var_info[ssa_ops[idx].result_def].type = zend_jit_trace_type_to_info(Z_TYPE_P(RT_CONSTANT(opline, opline->op2)));
1408+
ssa_var_info[ssa_ops[idx].result_def].type = _const_op_type(RT_CONSTANT(opline, opline->op2));
14091409
} else {
14101410
if (zend_update_type_info(op_array, tssa, script, (zend_op*)opline, ssa_ops + idx, ssa_opcodes, optimization_level) == FAILURE) {
14111411
// TODO:

0 commit comments

Comments
 (0)