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

Unified Diff: sdk/lib/_internal/compiler/implementation/lib/interceptors.dart

Issue 11412121: Fix dart2js hashCode implementations. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 1 month 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: sdk/lib/_internal/compiler/implementation/lib/interceptors.dart
diff --git a/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart b/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart
index 8ac1bd14db1b258fdf1da1bb0cc89c36894dddd6..4012b8c20a20e057675d3f77d3e55854ea5c9cad 100644
--- a/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart
+++ b/sdk/lib/_internal/compiler/implementation/lib/interceptors.dart
@@ -71,7 +71,11 @@ class JSFunction implements Function {
class JSBool implements bool {
const JSBool();
String toString() => JS('String', r'String(#)', this);
- int get hashCode => this ? 0x40377024 : 0xc18c0076;
+
+ // The values here are SMIs, co-prime and differ about half of the bit
+ // positions, including the low bit, so they are different mod 2^k.
+ int get hashCode => this ? (2 * 3 * 23 * 3761) : (269 * 811);
+
Type get runtimeType => createRuntimeType('bool');
}

Powered by Google App Engine
This is Rietveld 408576698