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

Unified Diff: runtime/lib/null_patch.dart

Issue 1860793002: Eliminate megamorphic lookup in Null.hashCode (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/lib/null_patch.dart
diff --git a/runtime/lib/null_patch.dart b/runtime/lib/null_patch.dart
index fb117d171c931a6932568b529b66d8fd50bbbb8d..61972d186647457abccdffbbc5289af6d5cdb924 100644
--- a/runtime/lib/null_patch.dart
+++ b/runtime/lib/null_patch.dart
@@ -7,13 +7,12 @@
patch class Null {
factory Null._uninstantiable() {
- throw new UnsupportedError(
- "class Null cannot be instantiated");
+ throw new UnsupportedError("class Null cannot be instantiated");
}
- int get _identityHashCode {
- return 2011; // The year Dart was announced and a prime.
- }
+ static const _HASH_CODE = 2011; // The year Dart was announced and a prime.
+ int get _identityHashCode => _HASH_CODE;
+ int get hashCode => _HASH_CODE;
String toString() {
return 'null';
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698