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

Unified Diff: sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart

Issue 12033008: Fix bug https://code.google.com/p/dart/issues/detail?id=7994: the range analysis gives a fixed rang… (Closed) Base URL: http://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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/language/fixed_length_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart (revision 17334)
+++ sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart (working copy)
@@ -428,16 +428,17 @@
final Value upper;
final ValueRangeInfo info;
Range(this.lower, this.upper, this.info);
- Range.unbound(this.info)
- : lower = const MinIntValue(),
- upper = const MaxIntValue();
+
+ Range.unbound(info) : this(const MinIntValue(), const MaxIntValue(), info);
+
/**
* Checks if the given values are unknown, and creates a
* range that does not have any unknown values.
*/
- Range.normalize(Value low, Value up, this.info)
- : lower = low == const UnknownValue() ? const MinIntValue() : low,
- upper = up == const UnknownValue() ? const MaxIntValue() : up;
+ Range.normalize(Value low, Value up, info) : this(
+ low == const UnknownValue() ? const MinIntValue() : low,
+ up == const UnknownValue() ? const MaxIntValue() : up,
+ info);
Range union(Range other) {
return info.newNormalizedRange(
@@ -684,10 +685,10 @@
}
if (!belowLength) {
- // Update the range of the index if using the length bounds
+ // Update the range of the index if using the maximum index
// narrows it.
Range newIndexRange = indexRange.intersection(
- info.newRange(lengthRange.lower, maxIndex));
+ info.newRange(info.intZero, maxIndex));
if (indexRange == newIndexRange) return indexRange;
HInstruction instruction = createRangeConversion(next, check.index);
ranges[instruction] = newIndexRange;
« no previous file with comments | « no previous file | tests/language/fixed_length_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698