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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 12340108: Remove dead phis as soon as they are discovered. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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 33fad69afca7109c49c68967186f8a48629d4fd8..7ac6c8b7c3ca6ae986065d1bb9ec6cf3554a3e99 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -197,16 +197,14 @@ void ValueInliningContext::ReplaceCall(FlowGraph* caller_graph,
}
// If the call has uses, create a phi of the returns.
if (call->HasUses()) {
- // Environment count: length before call - argument count (+ return)
- intptr_t env_count = call->env()->Length() - call->ArgumentCount();
// Add a phi of the return values.
- join->InsertPhi(env_count, env_count + 1);
- PhiInstr* phi = join->phis()->Last();
+ PhiInstr* phi = new PhiInstr(join, num_exits);
phi->set_ssa_temp_index(caller_graph->alloc_ssa_temp_index());
phi->mark_alive();
for (intptr_t i = 0; i < num_exits; ++i) {
phi->SetInputAt(i, ValueAt(i));
}
+ join->InsertPhi(phi);
// Replace uses of the call with the phi.
call->ReplaceUsesWith(phi);
} else {

Powered by Google App Engine
This is Rietveld 408576698