| Index: runtime/vm/flow_graph_builder.cc
|
| diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
|
| index ce2e218b5d125153590e02a7581e165dcb211f26..236c4d9dd7ea7069257f6131573bb0871530638f 100644
|
| --- a/runtime/vm/flow_graph_builder.cc
|
| +++ b/runtime/vm/flow_graph_builder.cc
|
| @@ -762,7 +762,12 @@ bool EffectGraphVisitor::CanSkipTypeCheck(intptr_t token_pos,
|
| return false;
|
| }
|
|
|
| - const bool eliminated = value->Type()->IsAssignableTo(dst_type);
|
| + // Propagated types are not set yet.
|
| + // More checks will possibly be eliminated during type propagation.
|
| + bool is_null, is_instance;
|
| + const bool eliminated =
|
| + (value->CanComputeIsNull(&is_null) && is_null) ||
|
| + (value->CanComputeIsInstanceOf(dst_type, &is_instance) && is_instance);
|
| if (FLAG_trace_type_check_elimination) {
|
| FlowGraphPrinter::PrintTypeCheck(owner()->parsed_function(),
|
| token_pos,
|
|
|