| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 #include "vm/flow_graph_optimizer.h" | 5 #include "vm/flow_graph_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/flow_graph_builder.h" | 7 #include "vm/flow_graph_builder.h" |
| 8 #include "vm/il_printer.h" | 8 #include "vm/il_printer.h" |
| 9 #include "vm/object_store.h" | 9 #include "vm/object_store.h" |
| 10 | 10 |
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 607 void FlowGraphOptimizer::VisitDo(DoInstr* instr) { | 607 void FlowGraphOptimizer::VisitDo(DoInstr* instr) { |
| 608 instr->computation()->Accept(this); | 608 instr->computation()->Accept(this); |
| 609 } | 609 } |
| 610 | 610 |
| 611 | 611 |
| 612 void FlowGraphOptimizer::VisitBind(BindInstr* instr) { | 612 void FlowGraphOptimizer::VisitBind(BindInstr* instr) { |
| 613 instr->computation()->Accept(this); | 613 instr->computation()->Accept(this); |
| 614 } | 614 } |
| 615 | 615 |
| 616 | 616 |
| 617 |
| 618 FlowGraphAnalyzer::FlowGraphAnalyzer( |
| 619 const GrowableArray<BlockEntryInstr*>& blocks) |
| 620 :blocks_(blocks), is_leaf_(false) {} |
| 621 |
| 622 |
| 623 void FlowGraphAnalyzer::Analyze() { |
| 624 is_leaf_ = true; |
| 625 for (intptr_t i = 0; i < blocks_.length(); ++i) { |
| 626 BlockEntryInstr* block_entry = blocks_[i]; |
| 627 Instruction* instr = block_entry->StraightLineSuccessor(); |
| 628 while ((instr != NULL) && !instr->IsBlockEntry()) { |
| 629 LocationSummary* locs = instr->locs(); |
| 630 if (locs != NULL) { |
| 631 if (locs->is_call()) { |
| 632 is_leaf_ = false; |
| 633 return; |
| 634 } |
| 635 } |
| 636 instr = instr->StraightLineSuccessor(); |
| 637 } |
| 638 } |
| 639 } |
| 640 |
| 617 } // namespace dart | 641 } // namespace dart |
| OLD | NEW |