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

Side by Side Diff: pkg/compiler/lib/src/resolution/tree_elements.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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/library_loader.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.resolution.tree_elements; 5 library dart2js.resolution.tree_elements;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../constants/expressions.dart'; 8 import '../constants/expressions.dart';
9 import '../dart_types.dart'; 9 import '../dart_types.dart';
10 import '../diagnostics/source_span.dart'; 10 import '../diagnostics/source_span.dart';
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 132
133 /// Map from labels to their label definition. 133 /// Map from labels to their label definition.
134 Map<Label, LabelDefinition> _definedLabels; 134 Map<Label, LabelDefinition> _definedLabels;
135 135
136 /// Map from labeled goto statements to the labels they target. 136 /// Map from labeled goto statements to the labels they target.
137 Map<GotoStatement, LabelDefinition> _targetLabels; 137 Map<GotoStatement, LabelDefinition> _targetLabels;
138 138
139 /// Map from nodes to native data. 139 /// Map from nodes to native data.
140 Map<Node, dynamic> _nativeData; 140 Map<Node, dynamic> _nativeData;
141 141
142 final int hashCode = ++_hashCodeCounter; 142 final int hashCode = _hashCodeCounter = (_hashCodeCounter + 1).toUnsigned(30);
143 static int _hashCodeCounter = 0; 143 static int _hashCodeCounter = 0;
144 144
145 TreeElementMapping(this.analyzedElement); 145 TreeElementMapping(this.analyzedElement);
146 146
147 operator []=(Node node, Element element) { 147 operator []=(Node node, Element element) {
148 // TODO(johnniwinther): Simplify this invariant to use only declarations in 148 // TODO(johnniwinther): Simplify this invariant to use only declarations in
149 // [TreeElements]. 149 // [TreeElements].
150 assert(invariant(node, () { 150 assert(invariant(node, () {
151 if (!element.isMalformed && analyzedElement != null && element.isPatch) { 151 if (!element.isMalformed && analyzedElement != null && element.isPatch) {
152 return analyzedElement.implementationLibrary.isPatch; 152 return analyzedElement.implementationLibrary.isPatch;
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 _nativeData = <Node, dynamic>{}; 521 _nativeData = <Node, dynamic>{};
522 } 522 }
523 _nativeData[node] = nativeData; 523 _nativeData[node] = nativeData;
524 } 524 }
525 525
526 @override 526 @override
527 dynamic getNativeData(Node node) { 527 dynamic getNativeData(Node node) {
528 return _nativeData != null ? _nativeData[node] : null; 528 return _nativeData != null ? _nativeData[node] : null;
529 } 529 }
530 } 530 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/library_loader.dart ('k') | pkg/compiler/lib/src/ssa/builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698