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

Unified Diff: runtime/vm/flow_graph_optimizer.cc

Issue 11856010: Change the inlining context from an enum to a class. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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_optimizer.cc
diff --git a/runtime/vm/flow_graph_optimizer.cc b/runtime/vm/flow_graph_optimizer.cc
index 788d44e0818b5bfaccfcb15cce25bcf487821963..3e922c45bc5af1b849bca72d772334c131888dbe 100644
--- a/runtime/vm/flow_graph_optimizer.cc
+++ b/runtime/vm/flow_graph_optimizer.cc
@@ -131,8 +131,8 @@ static void ReplaceCurrentInstruction(ForwardInstructionIterator* it,
Instruction* current,
Instruction* replacement,
FlowGraph* graph) {
- if ((replacement != NULL) && current->IsDefinition()) {
- Definition* current_defn = current->AsDefinition();
+ Definition* current_defn = current->AsDefinition();
+ if ((replacement != NULL) && (current_defn != NULL)) {
Definition* replacement_defn = replacement->AsDefinition();
ASSERT(replacement_defn != NULL);
current_defn->ReplaceUsesWith(replacement_defn);
@@ -144,14 +144,11 @@ static void ReplaceCurrentInstruction(ForwardInstructionIterator* it,
replacement_defn->ssa_temp_index());
}
} else if (FLAG_trace_optimization) {
- ASSERT(!current->IsDefinition() ||
- ((current->AsDefinition()->input_use_list() == NULL) &&
- (current->AsDefinition()->env_use_list() == NULL)));
- if (current->IsDefinition()) {
- OS::Print("Removing v%"Pd".\n",
- current->AsDefinition()->ssa_temp_index());
- } else {
+ if (current_defn == NULL) {
OS::Print("Removing %s\n", current->DebugName());
+ } else {
+ ASSERT(!current_defn->HasUses());
+ OS::Print("Removing v%"Pd".\n", current_defn->ssa_temp_index());
}
}
it->RemoveCurrentFromGraph();

Powered by Google App Engine
This is Rietveld 408576698