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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 14740005: Initial support for polymorphic inlining. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index b4b833ad9bd9c7a97ad7bfd6a73fe396d64403c2..ec4247a162ceddd48a43282d5ec23ab8dfdaf2af 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -96,6 +96,15 @@ void InlineExitCollector::AddExit(ReturnInstr* exit) {
}
+void InlineExitCollector::Union(const InlineExitCollector* other) {
+ // It doesn't make sense to combine different calls or calls from
+ // different graphs.
+ ASSERT(caller_graph_ == other->caller_graph_);
+ ASSERT(call_ == other->call_);
+ exits_.AddArray(other->exits_);
+}
+
+
int InlineExitCollector::LowestBlockIdFirst(const Data* a, const Data* b) {
return (a->exit_block->block_id() - b->exit_block->block_id());
}
@@ -132,7 +141,7 @@ Definition* InlineExitCollector::JoinReturns(BlockEntryInstr** exit_block,
caller_graph_->set_max_block_id(join_id);
JoinEntryInstr* join =
new JoinEntryInstr(join_id, CatchClauseNode::kInvalidTryIndex);
- join->InheritDeoptTarget(call_);
+ join->InheritDeoptTargetAfter(call_);
// The dominator set of the join is the intersection of the dominator
// sets of all the predecessors. If we keep the dominator sets ordered
@@ -179,7 +188,8 @@ Definition* InlineExitCollector::JoinReturns(BlockEntryInstr** exit_block,
// We either exhausted the dominators for this block before
// exhausting the current intersection, or else we found a block
// on the path from the root of the tree that is not in common.
- ASSERT(j >= 2);
+ // I.e., there cannot be an empty set of dominators.
+ ASSERT(j > 0);
join_dominators.TruncateTo(j);
break;
}

Powered by Google App Engine
This is Rietveld 408576698