Index: runtime/vm/flow_graph_type_propagator.cc |
diff --git a/runtime/vm/flow_graph_type_propagator.cc b/runtime/vm/flow_graph_type_propagator.cc |
index 2b7001f656104549b25930aefbf2c9124cc4f30f..9d0829d0dd7416f9d6127b9c42db5007940d3549 100644 |
--- a/runtime/vm/flow_graph_type_propagator.cc |
+++ b/runtime/vm/flow_graph_type_propagator.cc |
@@ -318,7 +318,9 @@ void FlowGraphTypePropagator::VisitCheckClassId(CheckClassIdInstr* check) { |
void FlowGraphTypePropagator::VisitGuardFieldClass( |
GuardFieldClassInstr* guard) { |
const intptr_t cid = guard->field().guarded_cid(); |
- if ((cid == kIllegalCid) || (cid == kDynamicCid)) { |
+ if ((cid == kIllegalCid) || |
+ (cid == kDynamicCid) || |
+ !CheckClassInstr::IsImmutableClassId(cid)) { |
return; |
} |
@@ -794,13 +796,17 @@ CompileType ConstantInstr::ComputeType() const { |
return CompileType::Null(); |
} |
+ intptr_t cid = value().GetClassId(); |
+ if (!CheckClassInstr::IsImmutableClassId(cid)) { |
+ cid = kDynamicCid; |
+ } |
+ |
if (value().IsInstance()) { |
- return CompileType::Create( |
- value().GetClassId(), |
+ return CompileType::Create(cid, |
AbstractType::ZoneHandle(Instance::Cast(value()).GetType())); |
} else { |
// Type info for non-instance objects. |
- return CompileType::FromCid(value().GetClassId()); |
+ return CompileType::FromCid(cid); |
} |
} |