| 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 604 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 | 615 |
| 616 | 616 |
| 617 void FlowGraphOptimizer::VisitStrictCompareComp(StrictCompareComp* comp) { | 617 void FlowGraphOptimizer::VisitStrictCompareComp(StrictCompareComp* comp) { |
| 618 // TODO(vegorov): recognize the pattern with BooleanNegate between comparsion | 618 // TODO(vegorov): recognize the pattern with BooleanNegate between comparsion |
| 619 // and a branch. | 619 // and a branch. |
| 620 TryFuseComparisonWithBranch(comp); | 620 TryFuseComparisonWithBranch(comp); |
| 621 } | 621 } |
| 622 | 622 |
| 623 | 623 |
| 624 void FlowGraphOptimizer::VisitEqualityCompare(EqualityCompareComp* comp) { | 624 void FlowGraphOptimizer::VisitEqualityCompare(EqualityCompareComp* comp) { |
| 625 if (!comp->HasICData()) return; |
| 626 const ICData& ic_data = *comp->ic_data(); |
| 627 if (ic_data.NumberOfChecks() != 1) return; |
| 628 ASSERT(HasOneTarget(ic_data)); |
| 629 if (HasTwoSmi(ic_data)) { |
| 630 comp->set_operands_class_id(kSmi); |
| 631 } else { |
| 632 return; |
| 633 } |
| 625 // TODO(vegorov): recognize the pattern with BooleanNegate between comparsion | 634 // TODO(vegorov): recognize the pattern with BooleanNegate between comparsion |
| 626 // and a branch. | 635 // and a branch. |
| 627 TryFuseComparisonWithBranch(comp); | 636 TryFuseComparisonWithBranch(comp); |
| 628 } | 637 } |
| 629 | 638 |
| 630 | 639 |
| 631 void FlowGraphOptimizer::VisitDo(DoInstr* instr) { | 640 void FlowGraphOptimizer::VisitDo(DoInstr* instr) { |
| 632 instr->computation()->Accept(this); | 641 instr->computation()->Accept(this); |
| 633 } | 642 } |
| 634 | 643 |
| 635 | 644 |
| 636 void FlowGraphOptimizer::VisitBind(BindInstr* instr) { | 645 void FlowGraphOptimizer::VisitBind(BindInstr* instr) { |
| 637 instr->computation()->Accept(this); | 646 instr->computation()->Accept(this); |
| 638 } | 647 } |
| 639 | 648 |
| 640 | 649 |
| 641 } // namespace dart | 650 } // namespace dart |
| OLD | NEW |