| 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/intermediate_language.h" | 5 #include "vm/intermediate_language.h" |
| 6 | 6 |
| 7 #include "vm/bit_vector.h" | 7 #include "vm/bit_vector.h" |
| 8 #include "vm/dart_entry.h" | 8 #include "vm/dart_entry.h" |
| 9 #include "vm/flow_graph_allocator.h" | 9 #include "vm/flow_graph_allocator.h" |
| 10 #include "vm/flow_graph_builder.h" | 10 #include "vm/flow_graph_builder.h" |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 UnuseAllInputs(); | 601 UnuseAllInputs(); |
| 602 } | 602 } |
| 603 set_previous(NULL); | 603 set_previous(NULL); |
| 604 set_next(NULL); | 604 set_next(NULL); |
| 605 } | 605 } |
| 606 | 606 |
| 607 | 607 |
| 608 BranchInstr::BranchInstr(ComparisonInstr* comparison, bool is_checked) | 608 BranchInstr::BranchInstr(ComparisonInstr* comparison, bool is_checked) |
| 609 : comparison_(comparison), | 609 : comparison_(comparison), |
| 610 is_checked_(is_checked), | 610 is_checked_(is_checked), |
| 611 constrained_type_(NULL) { | 611 constrained_type_(NULL), |
| 612 constant_target_(NULL) { |
| 612 for (intptr_t i = comparison->InputCount() - 1; i >= 0; --i) { | 613 for (intptr_t i = comparison->InputCount() - 1; i >= 0; --i) { |
| 613 comparison->InputAt(i)->set_instruction(this); | 614 comparison->InputAt(i)->set_instruction(this); |
| 614 } | 615 } |
| 615 } | 616 } |
| 616 | 617 |
| 617 | 618 |
| 618 void BranchInstr::RawSetInputAt(intptr_t i, Value* value) { | 619 void BranchInstr::RawSetInputAt(intptr_t i, Value* value) { |
| 619 comparison()->RawSetInputAt(i, value); | 620 comparison()->RawSetInputAt(i, value); |
| 620 } | 621 } |
| 621 | 622 |
| (...skipping 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2185 | 2186 |
| 2186 | 2187 |
| 2187 // Inclusive. | 2188 // Inclusive. |
| 2188 bool Range::IsWithin(intptr_t min_int, intptr_t max_int) const { | 2189 bool Range::IsWithin(intptr_t min_int, intptr_t max_int) const { |
| 2189 if (min().LowerBound().value() < min_int) return false; | 2190 if (min().LowerBound().value() < min_int) return false; |
| 2190 if (max().UpperBound().value() > max_int) return false; | 2191 if (max().UpperBound().value() > max_int) return false; |
| 2191 return true; | 2192 return true; |
| 2192 } | 2193 } |
| 2193 | 2194 |
| 2194 | 2195 |
| 2196 bool Range::IsUnsatisfiable() const { |
| 2197 // Constant case: For example [0, -1]. |
| 2198 if (Range::ConstantMin(this).value() > Range::ConstantMax(this).value()) { |
| 2199 return true; |
| 2200 } |
| 2201 // Symbol case: For example [v+1, v]. |
| 2202 if (DependOnSameSymbol(min(), max()) && min().offset() > max().offset()) { |
| 2203 return true; |
| 2204 } |
| 2205 return false; |
| 2206 } |
| 2207 |
| 2208 |
| 2195 bool CheckArrayBoundInstr::IsFixedLengthArrayType(intptr_t cid) { | 2209 bool CheckArrayBoundInstr::IsFixedLengthArrayType(intptr_t cid) { |
| 2196 return LoadFieldInstr::IsFixedLengthArrayCid(cid); | 2210 return LoadFieldInstr::IsFixedLengthArrayCid(cid); |
| 2197 } | 2211 } |
| 2198 | 2212 |
| 2199 | 2213 |
| 2200 bool CheckArrayBoundInstr::IsRedundant(RangeBoundary length) { | 2214 bool CheckArrayBoundInstr::IsRedundant(RangeBoundary length) { |
| 2201 // Check that array has an immutable length. | 2215 // Check that array has an immutable length. |
| 2202 if (!IsFixedLengthArrayType(array_type())) { | 2216 if (!IsFixedLengthArrayType(array_type())) { |
| 2203 return false; | 2217 return false; |
| 2204 } | 2218 } |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2340 default: | 2354 default: |
| 2341 UNREACHABLE(); | 2355 UNREACHABLE(); |
| 2342 } | 2356 } |
| 2343 return kPowRuntimeEntry; | 2357 return kPowRuntimeEntry; |
| 2344 } | 2358 } |
| 2345 | 2359 |
| 2346 | 2360 |
| 2347 #undef __ | 2361 #undef __ |
| 2348 | 2362 |
| 2349 } // namespace dart | 2363 } // namespace dart |
| OLD | NEW |