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

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

Issue 17569004: Implement hashCode on objects stored in a set or used as map keys. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased on CL 17588005. Created 7 years, 6 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
Index: dart/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart
diff --git a/dart/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart b/dart/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart
index e067089bddd42b2f8f5579d733069b16fd334606..42560e0f6dc6840c5e7307ae084fc1cadd550a04 100644
--- a/dart/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart
+++ b/dart/sdk/lib/_internal/compiler/implementation/ssa/value_range_analyzer.dart
@@ -148,6 +148,8 @@ class IntValue extends Value {
return this.value == other.value;
}
+ int get hashCode => throw new UnsupportedError('IntValue.hashCode');
ngeoffray 2013/06/24 19:43:10 Changes in this file tend to show that it's not so
ahe 2013/06/24 20:18:54 You'd still get a warning. The rule is simple bec
sra1 2013/06/25 03:33:38 I don't like the changes in this file. There is n
ahe 2013/06/25 05:24:58 I find it peculiar that you would use this particu
+
String toString() => 'IntValue $value';
bool get isNegative => value < 0;
bool get isPositive => value >= 0;
@@ -214,6 +216,8 @@ class InstructionValue extends Value {
return this.instruction == other.instruction;
}
+ int get hashCode => throw new UnsupportedError('InstructionValue.hashCode');
+
Value operator +(Value other) {
if (other.isZero) return this;
if (other is IntValue) {
@@ -283,6 +287,8 @@ class AddValue extends BinaryOperationValue {
|| (left == other.right && right == other.left);
}
+ int get hashCode => throw new UnsupportedError('AddValue.hashCode');
+
Value operator -() => -left - right;
Value operator +(Value other) {
@@ -328,6 +334,8 @@ class SubtractValue extends BinaryOperationValue {
return left == other.left && right == other.right;
}
+ int get hashCode => throw new UnsupportedError('SubtractValue.hashCode');
+
Value operator -() => right - left;
Value operator +(Value other) {
@@ -374,6 +382,8 @@ class NegateValue extends Value {
return value == other.value;
}
+ int get hashCode => throw new UnsupportedError('Negate.hashCode');
+
Value operator +(other) {
if (other.isZero) return this;
if (other == value) return info.intZero;
@@ -506,6 +516,8 @@ class Range {
return other.lower == lower && other.upper == upper;
}
+ int get hashCode => throw new UnsupportedError('Range.hashCode');
+
bool operator <(Range other) {
return upper != other.lower && upper.min(other.lower) == upper;
}

Powered by Google App Engine
This is Rietveld 408576698