| 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 537 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 548 if (next_comp->IsBooleanNegate()) { | 548 if (next_comp->IsBooleanNegate()) { |
| 549 Instruction* next_next_instr = next_instr->next(); | 549 Instruction* next_next_instr = next_instr->next(); |
| 550 if ((next_next_instr != NULL) && next_next_instr->IsBranch()) { | 550 if ((next_next_instr != NULL) && next_next_instr->IsBranch()) { |
| 551 BooleanNegateComp* negate = next_comp->AsBooleanNegate(); | 551 BooleanNegateComp* negate = next_comp->AsBooleanNegate(); |
| 552 BranchInstr* branch = next_next_instr->AsBranch(); | 552 BranchInstr* branch = next_next_instr->AsBranch(); |
| 553 if ((branch->value()->AsUse()->definition() == next_instr) && | 553 if ((branch->value()->AsUse()->definition() == next_instr) && |
| 554 (negate->value()->AsUse()->definition() == instr)) { | 554 (negate->value()->AsUse()->definition() == instr)) { |
| 555 comp->MarkFusedWithBranch(branch); | 555 comp->MarkFusedWithBranch(branch); |
| 556 branch->MarkFusedWithComparison(comp); | 556 branch->MarkFusedWithComparison(comp); |
| 557 branch->set_is_negated(true); | 557 branch->set_is_negated(true); |
| 558 | 558 // Remove the comparison and the boolean negation from the graph. |
| 559 // Remove comparison and boolean negation from the graph. | |
| 560 branch->set_previous(instr->previous()); | 559 branch->set_previous(instr->previous()); |
| 561 instr->previous()->set_next(branch); | 560 instr->previous()->set_next(branch); |
| 562 return; | 561 return; |
| 563 } | 562 } |
| 564 } | 563 } |
| 565 } | 564 } |
| 566 } | 565 } |
| 567 } | 566 } |
| 568 | 567 |
| 569 | 568 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 LocationSummary* locs = it.Current()->locs(); | 624 LocationSummary* locs = it.Current()->locs(); |
| 626 if ((locs != NULL) && locs->is_call()) { | 625 if ((locs != NULL) && locs->is_call()) { |
| 627 is_leaf_ = false; | 626 is_leaf_ = false; |
| 628 return; | 627 return; |
| 629 } | 628 } |
| 630 } | 629 } |
| 631 } | 630 } |
| 632 } | 631 } |
| 633 | 632 |
| 634 } // namespace dart | 633 } // namespace dart |
| OLD | NEW |