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

Side by Side Diff: pkg/compiler/lib/src/tree/nodes.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/ssa/builder.dart ('k') | no next file » | 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) 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 import 'dart:collection' show IterableMixin; 5 import 'dart:collection' show IterableMixin;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../elements/elements.dart' show MetadataAnnotation; 8 import '../elements/elements.dart' show MetadataAnnotation;
9 import '../resolution/secret_tree_element.dart' 9 import '../resolution/secret_tree_element.dart'
10 show NullTreeElementMixin, StoredTreeElementMixin; 10 show NullTreeElementMixin, StoredTreeElementMixin;
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after
288 * 288 *
289 * The abstract part of "abstract syntax tree" is invalidated when 289 * The abstract part of "abstract syntax tree" is invalidated when
290 * supporting tools such as code formatting. These tools need concrete 290 * supporting tools such as code formatting. These tools need concrete
291 * syntax such as parentheses and no constant folding. 291 * syntax such as parentheses and no constant folding.
292 * 292 *
293 * We support these tools by storing additional references back to the 293 * We support these tools by storing additional references back to the
294 * token stream. These references are stored in fields ending with 294 * token stream. These references are stored in fields ending with
295 * "Token". 295 * "Token".
296 */ 296 */
297 abstract class Node extends NullTreeElementMixin implements Spannable { 297 abstract class Node extends NullTreeElementMixin implements Spannable {
298 final int hashCode; 298 final int hashCode = _HASH_COUNTER = (_HASH_COUNTER + 1).toUnsigned(30);
299 static int _HASH_COUNTER = 0; 299 static int _HASH_COUNTER = 0;
300 300
301 Node() : hashCode = ++_HASH_COUNTER; 301 Node();
302 302
303 accept(Visitor visitor); 303 accept(Visitor visitor);
304 304
305 accept1(Visitor1 visitor, arg); 305 accept1(Visitor1 visitor, arg);
306 306
307 visitChildren(Visitor visitor); 307 visitChildren(Visitor visitor);
308 308
309 visitChildren1(Visitor1 visitor, arg); 309 visitChildren1(Visitor1 visitor, arg);
310 310
311 /** 311 /**
(...skipping 2814 matching lines...) Expand 10 before | Expand all | Expand 10 after
3126 3126
3127 // VariableDefinitions. 3127 // VariableDefinitions.
3128 get metadata => null; 3128 get metadata => null;
3129 get type => null; 3129 get type => null;
3130 3130
3131 // Typedef. 3131 // Typedef.
3132 get typeParameters => null; 3132 get typeParameters => null;
3133 get formals => null; 3133 get formals => null;
3134 get typedefKeyword => null; 3134 get typedefKeyword => null;
3135 } 3135 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/builder.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698