| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/cha.h" | 8 #include "vm/cha.h" |
| 9 #include "vm/flow_graph_builder.h" | 9 #include "vm/flow_graph_builder.h" |
| 10 #include "vm/flow_graph_compiler.h" | 10 #include "vm/flow_graph_compiler.h" |
| (...skipping 3515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3526 for (BitVector::Iterator loop_it(header->loop_info()); | 3526 for (BitVector::Iterator loop_it(header->loop_info()); |
| 3527 !loop_it.Done(); | 3527 !loop_it.Done(); |
| 3528 loop_it.Advance()) { | 3528 loop_it.Advance()) { |
| 3529 BlockEntryInstr* block = flow_graph()->preorder()[loop_it.Current()]; | 3529 BlockEntryInstr* block = flow_graph()->preorder()[loop_it.Current()]; |
| 3530 for (ForwardInstructionIterator it(block); | 3530 for (ForwardInstructionIterator it(block); |
| 3531 !it.Done(); | 3531 !it.Done(); |
| 3532 it.Advance()) { | 3532 it.Advance()) { |
| 3533 Instruction* current = it.Current(); | 3533 Instruction* current = it.Current(); |
| 3534 if ((current->AllowsCSE() && | 3534 if ((current->AllowsCSE() && |
| 3535 block_effects->CanBeMovedTo(current, pre_header)) || | 3535 block_effects->CanBeMovedTo(current, pre_header)) || |
| 3536 IsLoopInvariantLoad(loop_invariant_loads, i, current)) { | 3536 IsLoopInvariantLoad(loop_invariant_loads, i, current)) { |
| 3537 bool inputs_loop_invariant = true; | 3537 bool inputs_loop_invariant = true; |
| 3538 for (int i = 0; i < current->InputCount(); ++i) { | 3538 for (int i = 0; i < current->InputCount(); ++i) { |
| 3539 Definition* input_def = current->InputAt(i)->definition(); | 3539 Definition* input_def = current->InputAt(i)->definition(); |
| 3540 if (!input_def->GetBlock()->Dominates(pre_header)) { | 3540 if (!input_def->GetBlock()->Dominates(pre_header)) { |
| 3541 inputs_loop_invariant = false; | 3541 inputs_loop_invariant = false; |
| 3542 break; | 3542 break; |
| 3543 } | 3543 } |
| 3544 } | 3544 } |
| 3545 if (inputs_loop_invariant && | 3545 if (inputs_loop_invariant && |
| 3546 !current->IsAssertAssignable() && | 3546 !current->IsAssertAssignable() && |
| (...skipping 3024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6571 | 6571 |
| 6572 // Insert materializations at environment uses. | 6572 // Insert materializations at environment uses. |
| 6573 const Class& cls = Class::Handle(alloc->constructor().Owner()); | 6573 const Class& cls = Class::Handle(alloc->constructor().Owner()); |
| 6574 for (intptr_t i = 0; i < exits.length(); i++) { | 6574 for (intptr_t i = 0; i < exits.length(); i++) { |
| 6575 CreateMaterializationAt(exits[i], alloc, cls, *fields); | 6575 CreateMaterializationAt(exits[i], alloc, cls, *fields); |
| 6576 } | 6576 } |
| 6577 } | 6577 } |
| 6578 | 6578 |
| 6579 | 6579 |
| 6580 } // namespace dart | 6580 } // namespace dart |
| OLD | NEW |