Chromium Code Reviews| 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/bigint_operations.h" | 7 #include "vm/bigint_operations.h" |
| 8 #include "vm/bit_vector.h" | 8 #include "vm/bit_vector.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/flow_graph_allocator.h" | 10 #include "vm/flow_graph_allocator.h" |
| (...skipping 2501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2512 return false; | 2512 return false; |
| 2513 } | 2513 } |
| 2514 | 2514 |
| 2515 RangeBoundary max = CanonicalizeBoundary(index_range->max(), | 2515 RangeBoundary max = CanonicalizeBoundary(index_range->max(), |
| 2516 RangeBoundary::OverflowedMaxSmi()); | 2516 RangeBoundary::OverflowedMaxSmi()); |
| 2517 | 2517 |
| 2518 if (max.Overflowed()) { | 2518 if (max.Overflowed()) { |
| 2519 return false; | 2519 return false; |
| 2520 } | 2520 } |
| 2521 | 2521 |
| 2522 intptr_t known_array_length = GetGuardedArrayLength(); | |
| 2523 if (max.UpperBound().value() < known_array_length) { | |
|
srdjan
2013/08/27 15:50:33
How about "max.UpperBound().value() < GetGuardedAr
| |
| 2524 return true; | |
| 2525 } | |
| 2526 | |
| 2522 // Try to compare constant boundaries. | 2527 // Try to compare constant boundaries. |
| 2523 if (max.UpperBound().value() < length.LowerBound().value()) { | 2528 if (max.UpperBound().value() < length.LowerBound().value()) { |
| 2524 return true; | 2529 return true; |
| 2525 } | 2530 } |
| 2526 | 2531 |
| 2527 length = CanonicalizeBoundary(length, RangeBoundary::OverflowedMaxSmi()); | 2532 length = CanonicalizeBoundary(length, RangeBoundary::OverflowedMaxSmi()); |
| 2528 if (length.Overflowed()) { | 2533 if (length.Overflowed()) { |
| 2529 return false; | 2534 return false; |
| 2530 } | 2535 } |
| 2531 | 2536 |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2651 default: | 2656 default: |
| 2652 UNREACHABLE(); | 2657 UNREACHABLE(); |
| 2653 } | 2658 } |
| 2654 return kPowRuntimeEntry; | 2659 return kPowRuntimeEntry; |
| 2655 } | 2660 } |
| 2656 | 2661 |
| 2657 | 2662 |
| 2658 #undef __ | 2663 #undef __ |
| 2659 | 2664 |
| 2660 } // namespace dart | 2665 } // namespace dart |
| OLD | NEW |