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