| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |