| 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/aot_optimizer.h" | 5 #include "vm/aot_optimizer.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/branch_optimizer.h" | 8 #include "vm/branch_optimizer.h" |
| 9 #include "vm/cha.h" | 9 #include "vm/cha.h" |
| 10 #include "vm/compiler.h" | 10 #include "vm/compiler.h" |
| (...skipping 2725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2736 ASSERT(!store->IsUnboxedStore()); | 2736 ASSERT(!store->IsUnboxedStore()); |
| 2737 | 2737 |
| 2738 // Discard the environment from the original instruction because the store | 2738 // Discard the environment from the original instruction because the store |
| 2739 // can't deoptimize. | 2739 // can't deoptimize. |
| 2740 instr->RemoveEnvironment(); | 2740 instr->RemoveEnvironment(); |
| 2741 ReplaceCall(instr, store); | 2741 ReplaceCall(instr, store); |
| 2742 return true; | 2742 return true; |
| 2743 } | 2743 } |
| 2744 | 2744 |
| 2745 | 2745 |
| 2746 void AotOptimizer::ReplaceArrayBoundChecks() { | |
| 2747 for (BlockIterator block_it = flow_graph_->reverse_postorder_iterator(); | |
| 2748 !block_it.Done(); | |
| 2749 block_it.Advance()) { | |
| 2750 ForwardInstructionIterator it(block_it.Current()); | |
| 2751 current_iterator_ = ⁢ | |
| 2752 for (; !it.Done(); it.Advance()) { | |
| 2753 CheckArrayBoundInstr* check = it.Current()->AsCheckArrayBound(); | |
| 2754 if (check != NULL) { | |
| 2755 GenericCheckBoundInstr* new_check = new(Z) GenericCheckBoundInstr( | |
| 2756 new(Z) Value(check->length()->definition()), | |
| 2757 new(Z) Value(check->index()->definition()), | |
| 2758 check->deopt_id()); | |
| 2759 flow_graph_->InsertBefore(check, new_check, | |
| 2760 check->env(), FlowGraph::kEffect); | |
| 2761 current_iterator()->RemoveCurrentFromGraph(); | |
| 2762 } | |
| 2763 } | |
| 2764 } | |
| 2765 } | |
| 2766 | |
| 2767 | |
| 2768 } // namespace dart | 2746 } // namespace dart |
| OLD | NEW |