From: Dmitry Stogov Date: Tue, 17 Mar 2020 14:55:34 +0000 (+0300) Subject: Use _const_op_type() for converting constant into type info X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=29bef78e9f57bbd49cfc8ae4ea8f3cd6ee56b6e1;p=php Use _const_op_type() for converting constant into type info --- diff --git a/ext/opcache/jit/zend_jit_trace.c b/ext/opcache/jit/zend_jit_trace.c index f066699e63..0990069de3 100644 --- a/ext/opcache/jit/zend_jit_trace.c +++ b/ext/opcache/jit/zend_jit_trace.c @@ -1276,7 +1276,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin uint32_t info; if (opline->op1_type == IS_CONST) { - info = zend_jit_trace_type_to_info(Z_TYPE_P(RT_CONSTANT(opline, opline->op1))); + info = _const_op_type(RT_CONSTANT(opline, opline->op1)); } else { ZEND_ASSERT(ssa_ops[idx].op1_use >= 0); 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 if (opline->op1_type == IS_UNUSED) { return_value_info.type = MAY_BE_NULL; } else if (opline->op1_type == IS_CONST) { - return_value_info.type = zend_jit_trace_type_to_info(Z_TYPE_P(RT_CONSTANT(opline, opline->op1))); + return_value_info.type = _const_op_type(RT_CONSTANT(opline, opline->op1)); } else { ZEND_ASSERT(ssa_ops[idx].op1_use >= 0); 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 if (opline->opcode == ZEND_RECV_INIT && !(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) { /* RECV_INIT always copy the constant */ - ssa_var_info[ssa_ops[idx].result_def].type = zend_jit_trace_type_to_info(Z_TYPE_P(RT_CONSTANT(opline, opline->op2))); + ssa_var_info[ssa_ops[idx].result_def].type = _const_op_type(RT_CONSTANT(opline, opline->op2)); } else { if (zend_update_type_info(op_array, tssa, script, (zend_op*)opline, ssa_ops + idx, ssa_opcodes, optimization_level) == FAILURE) { // TODO: @@ -1405,7 +1405,7 @@ static zend_ssa *zend_jit_trace_build_tssa(zend_jit_trace_rec *trace_buffer, uin if (opline->opcode == ZEND_RECV_INIT && !(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) { /* RECV_INIT always copy the constant */ - ssa_var_info[ssa_ops[idx].result_def].type = zend_jit_trace_type_to_info(Z_TYPE_P(RT_CONSTANT(opline, opline->op2))); + ssa_var_info[ssa_ops[idx].result_def].type = _const_op_type(RT_CONSTANT(opline, opline->op2)); } else { if (zend_update_type_info(op_array, tssa, script, (zend_op*)opline, ssa_ops + idx, ssa_opcodes, optimization_level) == FAILURE) { // TODO: