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

Unified Diff: pkg/compiler/lib/src/library_loader.dart

Issue 2154583002: dart2js: get:hashCode methods to avoid Object.hashCode (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: xxx Created 4 years, 5 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: pkg/compiler/lib/src/library_loader.dart
diff --git a/pkg/compiler/lib/src/library_loader.dart b/pkg/compiler/lib/src/library_loader.dart
index be0cb41499551e76dde6f66fecb715fbc4dac788..0797b8fc4db316fb4440aa775e03f6c98a3c5da4 100644
--- a/pkg/compiler/lib/src/library_loader.dart
+++ b/pkg/compiler/lib/src/library_loader.dart
@@ -916,10 +916,9 @@ class ExportLink {
class LibraryDependencyNode {
final LibraryElementX library;
- // TODO(ahe): Remove [hashCodeCounter] and [hashCode] when
- // VM implementation of Object.hashCode is not slow.
- final int hashCode = ++hashCodeCounter;
- static int hashCodeCounter = 0;
+ // Stored identity based hashCode for performance.
+ final int hashCode = _nextHash = (_nextHash + 100019).toUnsigned(30);
+ static int _nextHash = 0;
/**
* A linked list of the import tags that import [library] mapped to the
« no previous file with comments | « pkg/compiler/lib/src/js_backend/runtime_types.dart ('k') | pkg/compiler/lib/src/resolution/tree_elements.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698