| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library dart2js.library_loader; | 5 library dart2js.library_loader; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'common/names.dart' show Uris; | 9 import 'common/names.dart' show Uris; |
| 10 import 'common/tasks.dart' show CompilerTask, Measurer; | 10 import 'common/tasks.dart' show CompilerTask, Measurer; |
| (...skipping 898 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 909 /** | 909 /** |
| 910 * A node in the library dependency graph. | 910 * A node in the library dependency graph. |
| 911 * | 911 * |
| 912 * This class is used to collect the library dependencies expressed through | 912 * This class is used to collect the library dependencies expressed through |
| 913 * import and export tags, and as the work-list entry in computations of library | 913 * import and export tags, and as the work-list entry in computations of library |
| 914 * exports performed in [LibraryDependencyHandler.computeExports]. | 914 * exports performed in [LibraryDependencyHandler.computeExports]. |
| 915 */ | 915 */ |
| 916 class LibraryDependencyNode { | 916 class LibraryDependencyNode { |
| 917 final LibraryElementX library; | 917 final LibraryElementX library; |
| 918 | 918 |
| 919 // TODO(ahe): Remove [hashCodeCounter] and [hashCode] when | 919 // Stored identity based hashCode for performance. |
| 920 // VM implementation of Object.hashCode is not slow. | 920 final int hashCode = _nextHash = (_nextHash + 100019).toUnsigned(30); |
| 921 final int hashCode = ++hashCodeCounter; | 921 static int _nextHash = 0; |
| 922 static int hashCodeCounter = 0; | |
| 923 | 922 |
| 924 /** | 923 /** |
| 925 * A linked list of the import tags that import [library] mapped to the | 924 * A linked list of the import tags that import [library] mapped to the |
| 926 * corresponding libraries. This is used to propagate exports into imports | 925 * corresponding libraries. This is used to propagate exports into imports |
| 927 * after the export scopes have been computed. | 926 * after the export scopes have been computed. |
| 928 */ | 927 */ |
| 929 Link<ImportLink> imports = const Link<ImportLink>(); | 928 Link<ImportLink> imports = const Link<ImportLink>(); |
| 930 | 929 |
| 931 /// A linked list of all libraries directly exported by [library]. | 930 /// A linked list of all libraries directly exported by [library]. |
| 932 Link<LibraryElement> exports = const Link<LibraryElement>(); | 931 Link<LibraryElement> exports = const Link<LibraryElement>(); |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1518 Future onLibrariesLoaded(LoadedLibraries results); | 1517 Future onLibrariesLoaded(LoadedLibraries results); |
| 1519 | 1518 |
| 1520 /// Called whenever a library element is created. | 1519 /// Called whenever a library element is created. |
| 1521 void onLibraryCreated(LibraryElement library); | 1520 void onLibraryCreated(LibraryElement library); |
| 1522 | 1521 |
| 1523 /// Called whenever a library is scanned from a script file. | 1522 /// Called whenever a library is scanned from a script file. |
| 1524 Future onLibraryScanned(LibraryElement library, LibraryLoader loader); | 1523 Future onLibraryScanned(LibraryElement library, LibraryLoader loader); |
| 1525 } | 1524 } |
| 1526 | 1525 |
| 1527 const _reuseLibrarySubtaskName = "Reuse library"; | 1526 const _reuseLibrarySubtaskName = "Reuse library"; |
| OLD | NEW |