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

Unified Diff: runtime/vm/flow_graph_builder.cc

Issue 12457034: Ensure that all goto instructions have deoptimization target. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Delete UNREACHABLE 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
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_builder.cc
diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
index 337eebe96c78aed74b28426ccd94e994bba614ce..de41072a3e11b13a4e2f431d3e47cf2199b11154 100644
--- a/runtime/vm/flow_graph_builder.cc
+++ b/runtime/vm/flow_graph_builder.cc
@@ -133,7 +133,7 @@ void InliningContext::ReplaceCall(FlowGraph* caller_graph,
} else if (num_exits == 1) {
// For just one exit, replace the uses and remove the call from the graph.
call->ReplaceUsesWith(ValueAt(0)->definition());
- ValueAt(0)->RemoveFromUseList();
+ ReturnAt(0)->UnuseAllInputs();
call->previous()->LinkTo(callee_entry->next());
LastInstructionAt(0)->LinkTo(call->next());
// In case of control flow, locally update the predecessors, phis and
@@ -186,8 +186,11 @@ void InliningContext::ReplaceCall(FlowGraph* caller_graph,
caller_graph->set_max_block_id(join_id);
JoinEntryInstr* join =
new JoinEntryInstr(join_id, CatchClauseNode::kInvalidTryIndex);
+ join->InheritDeoptTarget(call);
for (intptr_t i = 0; i < num_exits; ++i) {
- LastInstructionAt(i)->Goto(join);
+ GotoInstr* goto_instr = new GotoInstr(join);
+ goto_instr->InheritDeoptTarget(ReturnAt(i));
+ LastInstructionAt(i)->LinkTo(goto_instr);
// Directly add the predecessors of the join in ascending block id order.
join->predecessors_.Add(ExitBlockAt(i));
}
@@ -198,6 +201,7 @@ void InliningContext::ReplaceCall(FlowGraph* caller_graph,
phi->set_ssa_temp_index(caller_graph->alloc_ssa_temp_index());
phi->mark_alive();
for (intptr_t i = 0; i < num_exits; ++i) {
+ ReturnAt(i)->RemoveEnvironment();
phi->SetInputAt(i, ValueAt(i));
}
join->InsertPhi(phi);
@@ -207,7 +211,7 @@ void InliningContext::ReplaceCall(FlowGraph* caller_graph,
// In the case that the result is unused, remove the return value uses
// from their definition's use list.
for (intptr_t i = 0; i < num_exits; ++i) {
- ValueAt(i)->RemoveFromUseList();
+ ReturnAt(i)->UnuseAllInputs();
}
}
// Remove the call from the graph.
« no previous file with comments | « runtime/vm/flow_graph_builder.h ('k') | runtime/vm/flow_graph_compiler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698