| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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_range_analysis.h" | 5 #include "vm/flow_graph_range_analysis.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/il_printer.h" | 8 #include "vm/il_printer.h" |
| 9 | 9 |
| 10 namespace dart { | 10 namespace dart { |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 limit = constraint; | 121 limit = constraint; |
| 122 } | 122 } |
| 123 } | 123 } |
| 124 | 124 |
| 125 return limit; | 125 return limit; |
| 126 } | 126 } |
| 127 | 127 |
| 128 | 128 |
| 129 static InductionVariableInfo* DetectSimpleInductionVariable(PhiInstr* phi) { | 129 static InductionVariableInfo* DetectSimpleInductionVariable(PhiInstr* phi) { |
| 130 if (phi->Type()->ToCid() != kSmiCid) { | 130 if (phi->Type()->ToCid() != kSmiCid) { |
| 131 return false; | 131 return NULL; |
| 132 } | 132 } |
| 133 | 133 |
| 134 if (phi->InputCount() != 2) { | 134 if (phi->InputCount() != 2) { |
| 135 return false; | 135 return NULL; |
| 136 } | 136 } |
| 137 | 137 |
| 138 BitVector* loop_info = phi->block()->loop_info(); | 138 BitVector* loop_info = phi->block()->loop_info(); |
| 139 | 139 |
| 140 const intptr_t backedge_idx = | 140 const intptr_t backedge_idx = |
| 141 loop_info->Contains(phi->block()->PredecessorAt(0)->preorder_number()) | 141 loop_info->Contains(phi->block()->PredecessorAt(0)->preorder_number()) |
| 142 ? 0 : 1; | 142 ? 0 : 1; |
| 143 | 143 |
| 144 Definition* initial_value = | 144 Definition* initial_value = |
| 145 phi->InputAt(1 - backedge_idx)->definition(); | 145 phi->InputAt(1 - backedge_idx)->definition(); |
| (...skipping 2893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3039 } | 3039 } |
| 3040 } while (CanonicalizeMaxBoundary(&max) || | 3040 } while (CanonicalizeMaxBoundary(&max) || |
| 3041 CanonicalizeMinBoundary(&canonical_length)); | 3041 CanonicalizeMinBoundary(&canonical_length)); |
| 3042 | 3042 |
| 3043 // Failed to prove that maximum is bounded with array length. | 3043 // Failed to prove that maximum is bounded with array length. |
| 3044 return false; | 3044 return false; |
| 3045 } | 3045 } |
| 3046 | 3046 |
| 3047 | 3047 |
| 3048 } // namespace dart | 3048 } // namespace dart |
| OLD | NEW |