| Index: runtime/vm/flow_graph_builder.cc
|
| diff --git a/runtime/vm/flow_graph_builder.cc b/runtime/vm/flow_graph_builder.cc
|
| index 97cf73521e5800a378d3404dcaa8174f180047be..2e451e1780721aad4d49a1dda2f7547ed1cdf363 100644
|
| --- a/runtime/vm/flow_graph_builder.cc
|
| +++ b/runtime/vm/flow_graph_builder.cc
|
| @@ -372,6 +372,8 @@ void InlineExitCollector::PrepareGraphs(FlowGraph* callee_graph) {
|
| instr->AsGoto()->adjust_edge_weight(scale_factor);
|
| }
|
| }
|
| +
|
| + RemoveUnreachableExits(callee_graph);
|
| }
|
|
|
|
|
| @@ -395,6 +397,25 @@ int InlineExitCollector::LowestBlockIdFirst(const Data* a, const Data* b) {
|
| }
|
|
|
|
|
| +void InlineExitCollector::RemoveUnreachableExits(FlowGraph* callee_graph) {
|
| + const GrowableArray<BlockEntryInstr*>& postorder = callee_graph->postorder();
|
| + int j = 0;
|
| + for (int i = 0; i < exits_.length(); ++i) {
|
| + BlockEntryInstr* block = exits_[i].exit_return->GetBlock();
|
| + if ((block != NULL) &&
|
| + (0 <= block->postorder_number()) &&
|
| + (block->postorder_number() < postorder.length()) &&
|
| + (postorder[block->postorder_number()] == block)) {
|
| + if (i != j) {
|
| + exits_[j] = exits_[i];
|
| + }
|
| + j++;
|
| + }
|
| + }
|
| + exits_.TruncateTo(j);
|
| +}
|
| +
|
| +
|
| void InlineExitCollector::SortExits() {
|
| // Assign block entries here because we did not necessarily know them when
|
| // the return exit was added to the array.
|
|
|