]> granicus.if.org Git - php/commitdiff
Use _const_op_type() for converting constant into type info
authorDmitry Stogov <dmitry@zend.com>
Tue, 17 Mar 2020 14:55:34 +0000 (17:55 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 17 Mar 2020 14:55:34 +0000 (17:55 +0300)
ext/opcache/jit/zend_jit_trace.c

index f066699e63ec18a4106c1d4f684a19f339d7ca4b..0990069de36d91815e095d2d0445dc632d46a3c9 100644 (file)
@@ -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: