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

Side by Side Diff: pkg/analyzer/lib/src/generated/resolver.dart

Issue 934113002: Generate artificial hashCode for often used classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 engine.resolver; 5 library engine.resolver;
6 6
7 import "dart:math" as math; 7 import "dart:math" as math;
8 import 'dart:collection'; 8 import 'dart:collection';
9 9
10 import 'package:analyzer/src/generated/utilities_collection.dart'; 10 import 'package:analyzer/src/generated/utilities_collection.dart';
(...skipping 10060 matching lines...) Expand 10 before | Expand all | Expand 10 after
10071 * some (possibly different) library. They are not intended to be used except 10071 * some (possibly different) library. They are not intended to be used except
10072 * during the resolution process. 10072 * during the resolution process.
10073 */ 10073 */
10074 class ResolvableLibrary { 10074 class ResolvableLibrary {
10075 /** 10075 /**
10076 * An empty array that can be used to initialize lists of libraries. 10076 * An empty array that can be used to initialize lists of libraries.
10077 */ 10077 */
10078 static List<ResolvableLibrary> _EMPTY_ARRAY = new List<ResolvableLibrary>(0); 10078 static List<ResolvableLibrary> _EMPTY_ARRAY = new List<ResolvableLibrary>(0);
10079 10079
10080 /** 10080 /**
10081 * The next artificial hash code.
10082 */
10083 static int _NEXT_HASH_CODE = 0;
10084
10085 /**
10086 * The artifitial hash code for this object.
10087 */
10088 final int _hashCode = _NEXT_HASH_CODE++;
10089
10090 /**
10081 * The source specifying the defining compilation unit of this library. 10091 * The source specifying the defining compilation unit of this library.
10082 */ 10092 */
10083 final Source librarySource; 10093 final Source librarySource;
10084 10094
10085 /** 10095 /**
10086 * A list containing all of the libraries that are imported into this library. 10096 * A list containing all of the libraries that are imported into this library.
10087 */ 10097 */
10088 List<ResolvableLibrary> _importedLibraries = _EMPTY_ARRAY; 10098 List<ResolvableLibrary> _importedLibraries = _EMPTY_ARRAY;
10089 10099
10090 /** 10100 /**
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
10190 this._exportedLibraries = exportedLibraries; 10200 this._exportedLibraries = exportedLibraries;
10191 } 10201 }
10192 10202
10193 /** 10203 /**
10194 * Return an array containing the libraries that are exported from this librar y. 10204 * Return an array containing the libraries that are exported from this librar y.
10195 * 10205 *
10196 * @return an array containing the libraries that are exported from this libra ry 10206 * @return an array containing the libraries that are exported from this libra ry
10197 */ 10207 */
10198 List<ResolvableLibrary> get exports => _exportedLibraries; 10208 List<ResolvableLibrary> get exports => _exportedLibraries;
10199 10209
10210 @override
10211 int get hashCode => _hashCode;
10212
10200 /** 10213 /**
10201 * Set the libraries that are imported into this library to be those in the gi ven array. 10214 * Set the libraries that are imported into this library to be those in the gi ven array.
10202 * 10215 *
10203 * @param importedLibraries the libraries that are imported into this library 10216 * @param importedLibraries the libraries that are imported into this library
10204 */ 10217 */
10205 void set importedLibraries(List<ResolvableLibrary> importedLibraries) { 10218 void set importedLibraries(List<ResolvableLibrary> importedLibraries) {
10206 this._importedLibraries = importedLibraries; 10219 this._importedLibraries = importedLibraries;
10207 } 10220 }
10208 10221
10209 /** 10222 /**
(...skipping 5464 matching lines...) Expand 10 before | Expand all | Expand 10 after
15674 * library. 15687 * library.
15675 */ 15688 */
15676 final HashSet<String> members = new HashSet<String>(); 15689 final HashSet<String> members = new HashSet<String>();
15677 15690
15678 /** 15691 /**
15679 * Names of resolved or unresolved class members that are read in the 15692 * Names of resolved or unresolved class members that are read in the
15680 * library. 15693 * library.
15681 */ 15694 */
15682 final HashSet<String> readMembers = new HashSet<String>(); 15695 final HashSet<String> readMembers = new HashSet<String>();
15683 } 15696 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698