| 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 548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 559 return; | 559 return; |
| 560 } | 560 } |
| 561 | 561 |
| 562 // For smi and double comparisons if the next instruction is a conditional | 562 // For smi and double comparisons if the next instruction is a conditional |
| 563 // branch that uses the value of this comparison mark them as fused together | 563 // branch that uses the value of this comparison mark them as fused together |
| 564 // to avoid materializing a boolean value. | 564 // to avoid materializing a boolean value. |
| 565 TryFuseComparisonWithBranch(comp); | 565 TryFuseComparisonWithBranch(comp); |
| 566 } | 566 } |
| 567 | 567 |
| 568 | 568 |
| 569 void FlowGraphOptimizer::VisitStrictCompareComp(StrictCompareComp* comp) { | 569 void FlowGraphOptimizer::VisitStrictCompare(StrictCompareComp* comp) { |
| 570 TryFuseComparisonWithBranch(comp); | 570 TryFuseComparisonWithBranch(comp); |
| 571 } | 571 } |
| 572 | 572 |
| 573 | 573 |
| 574 void FlowGraphOptimizer::VisitEqualityCompare(EqualityCompareComp* comp) { | 574 void FlowGraphOptimizer::VisitEqualityCompare(EqualityCompareComp* comp) { |
| 575 if (comp->HasICData()) { | 575 if (comp->HasICData()) { |
| 576 // Replace binary checks with unary ones since EmitNative expects it. | 576 // Replace binary checks with unary ones since EmitNative expects it. |
| 577 ICData& unary_checks = | 577 ICData& unary_checks = |
| 578 ICData::Handle(ToUnaryClassChecks(*comp->ic_data())); | 578 ICData::Handle(ToUnaryClassChecks(*comp->ic_data())); |
| 579 comp->set_ic_data(&unary_checks); | 579 comp->set_ic_data(&unary_checks); |
| 580 } | 580 } |
| 581 | 581 |
| 582 TryFuseComparisonWithBranch(comp); | 582 TryFuseComparisonWithBranch(comp); |
| 583 } | 583 } |
| 584 | 584 |
| 585 | 585 |
| 586 void FlowGraphOptimizer::VisitDo(DoInstr* instr) { | 586 void FlowGraphOptimizer::VisitDo(DoInstr* instr) { |
| 587 instr->computation()->Accept(this); | 587 instr->computation()->Accept(this); |
| 588 } | 588 } |
| 589 | 589 |
| 590 | 590 |
| 591 void FlowGraphOptimizer::VisitBind(BindInstr* instr) { | 591 void FlowGraphOptimizer::VisitBind(BindInstr* instr) { |
| 592 instr->computation()->Accept(this); | 592 instr->computation()->Accept(this); |
| 593 } | 593 } |
| 594 | 594 |
| 595 | 595 |
| 596 } // namespace dart | 596 } // namespace dart |
| OLD | NEW |