Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(827)

Unified Diff: runtime/vm/flow_graph_type_propagator.cc

Issue 1091353002: Reland r45243. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..0d646b873fe13ff5d5894b33226e08d522901908 100644
--- a/runtime/vm/flow_graph_type_propagator.cc
+++ b/runtime/vm/flow_graph_type_propagator.cc
@@ -149,7 +149,7 @@ void FlowGraphTypePropagator::PropagateRecursive(BlockEntryInstr* block) {
}
}
- HandleBranchOnNull(block);
+ HandleBranchOnStrictCompare(block);
for (intptr_t i = 0; i < block->dominated_blocks().length(); ++i) {
PropagateRecursive(block->dominated_blocks()[i]);
@@ -159,7 +159,8 @@ void FlowGraphTypePropagator::PropagateRecursive(BlockEntryInstr* block) {
}
-void FlowGraphTypePropagator::HandleBranchOnNull(BlockEntryInstr* block) {
+void FlowGraphTypePropagator::HandleBranchOnStrictCompare(
+ BlockEntryInstr* block) {
BranchInstr* branch = block->last_instruction()->AsBranch();
if (branch == NULL) {
return;
@@ -318,7 +319,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 +797,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);
}
}
@@ -974,6 +981,9 @@ CompileType LoadStaticFieldInstr::ComputeType() const {
cid = obj.GetClassId();
}
}
+ if (!CheckClassInstr::IsImmutableClassId(cid)) {
+ cid = kDynamicCid;
+ }
return CompileType(is_nullable, cid, abstract_type);
}

Powered by Google App Engine
This is Rietveld 408576698