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