| 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 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 515 if (next_comp->IsBooleanNegate()) { | 515 if (next_comp->IsBooleanNegate()) { |
| 516 Instruction* next_next_instr = next_instr->next(); | 516 Instruction* next_next_instr = next_instr->next(); |
| 517 if ((next_next_instr != NULL) && next_next_instr->IsBranch()) { | 517 if ((next_next_instr != NULL) && next_next_instr->IsBranch()) { |
| 518 BooleanNegateComp* negate = next_comp->AsBooleanNegate(); | 518 BooleanNegateComp* negate = next_comp->AsBooleanNegate(); |
| 519 BranchInstr* branch = next_next_instr->AsBranch(); | 519 BranchInstr* branch = next_next_instr->AsBranch(); |
| 520 if ((branch->value()->AsUse()->definition() == next_instr) && | 520 if ((branch->value()->AsUse()->definition() == next_instr) && |
| 521 (negate->value()->AsUse()->definition() == instr)) { | 521 (negate->value()->AsUse()->definition() == instr)) { |
| 522 comp->MarkFusedWithBranch(branch); | 522 comp->MarkFusedWithBranch(branch); |
| 523 branch->MarkFusedWithComparison(comp); | 523 branch->MarkFusedWithComparison(comp); |
| 524 branch->set_is_negated(true); | 524 branch->set_is_negated(true); |
| 525 | 525 // Remove the comparison and the boolean negation from the graph. |
| 526 // Remove comparison and boolean negation from the graph. | |
| 527 branch->set_previous(instr->previous()); | 526 branch->set_previous(instr->previous()); |
| 528 instr->previous()->set_next(branch); | 527 instr->previous()->set_next(branch); |
| 529 return; | 528 return; |
| 530 } | 529 } |
| 531 } | 530 } |
| 532 } | 531 } |
| 533 } | 532 } |
| 534 } | 533 } |
| 535 | 534 |
| 536 | 535 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 597 LocationSummary* locs = it.Current()->locs(); | 596 LocationSummary* locs = it.Current()->locs(); |
| 598 if ((locs != NULL) && locs->is_call()) { | 597 if ((locs != NULL) && locs->is_call()) { |
| 599 is_leaf_ = false; | 598 is_leaf_ = false; |
| 600 return; | 599 return; |
| 601 } | 600 } |
| 602 } | 601 } |
| 603 } | 602 } |
| 604 } | 603 } |
| 605 | 604 |
| 606 } // namespace dart | 605 } // namespace dart |
| OLD | NEW |