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

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

Issue 11779017: Ensure that LowerBound and UpperBound return overflow marker when overflow occurs. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #ifndef VM_INTERMEDIATE_LANGUAGE_H_ 5 #ifndef VM_INTERMEDIATE_LANGUAGE_H_
6 #define VM_INTERMEDIATE_LANGUAGE_H_ 6 #define VM_INTERMEDIATE_LANGUAGE_H_
7 7
8 #include "vm/allocation.h" 8 #include "vm/allocation.h"
9 #include "vm/ast.h" 9 #include "vm/ast.h"
10 #include "vm/growable_array.h" 10 #include "vm/growable_array.h"
(...skipping 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after
1713 1713
1714 const RangeBoundary& min() const { return min_; } 1714 const RangeBoundary& min() const { return min_; }
1715 const RangeBoundary& max() const { return max_; } 1715 const RangeBoundary& max() const { return max_; }
1716 1716
1717 bool Equals(Range* other) { 1717 bool Equals(Range* other) {
1718 return min_.Equals(other->min_) && max_.Equals(other->max_); 1718 return min_.Equals(other->min_) && max_.Equals(other->max_);
1719 } 1719 }
1720 1720
1721 static RangeBoundary ConstantMin(Range* range) { 1721 static RangeBoundary ConstantMin(Range* range) {
1722 if (range == NULL) return RangeBoundary::MinSmi(); 1722 if (range == NULL) return RangeBoundary::MinSmi();
1723 return range->min().LowerBound(); 1723 return range->min().LowerBound().Clamp();
1724 } 1724 }
1725 1725
1726 static RangeBoundary ConstantMax(Range* range) { 1726 static RangeBoundary ConstantMax(Range* range) {
1727 if (range == NULL) return RangeBoundary::MaxSmi(); 1727 if (range == NULL) return RangeBoundary::MaxSmi();
1728 return range->max().UpperBound(); 1728 return range->max().UpperBound().Clamp();
1729 } 1729 }
1730 1730
1731 // Inclusive. 1731 // Inclusive.
1732 bool IsWithin(intptr_t min_int, intptr_t max_int) const; 1732 bool IsWithin(intptr_t min_int, intptr_t max_int) const;
1733 1733
1734 private: 1734 private:
1735 RangeBoundary min_; 1735 RangeBoundary min_;
1736 RangeBoundary max_; 1736 RangeBoundary max_;
1737 }; 1737 };
1738 1738
(...skipping 2584 matching lines...) Expand 10 before | Expand all | Expand 10 after
4323 ForwardInstructionIterator* current_iterator_; 4323 ForwardInstructionIterator* current_iterator_;
4324 4324
4325 private: 4325 private:
4326 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor); 4326 DISALLOW_COPY_AND_ASSIGN(FlowGraphVisitor);
4327 }; 4327 };
4328 4328
4329 4329
4330 } // namespace dart 4330 } // namespace dart
4331 4331
4332 #endif // VM_INTERMEDIATE_LANGUAGE_H_ 4332 #endif // VM_INTERMEDIATE_LANGUAGE_H_
OLDNEW
« no previous file with comments | « no previous file | runtime/vm/intermediate_language.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698