Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(833)

Side by Side Diff: runtime/vm/intermediate_language.cc

Issue 23584002: Replace guarded list length field loads with constants (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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
OLDNEW
« runtime/vm/intermediate_language.h ('K') | « runtime/vm/intermediate_language.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698