OLD | NEW |
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 dart2js.resolution.registry; | 5 library dart2js.resolution.registry; |
6 | 6 |
7 import '../common.dart'; | 7 import '../common.dart'; |
8 import '../common/backend_api.dart' | 8 import '../common/backend_api.dart' |
9 show Backend, ForeignResolver, NativeRegistry; | 9 show Backend, ForeignResolver, NativeRegistry; |
10 import '../common/registry.dart' show Registry; | |
11 import '../common/resolution.dart' show ResolutionImpact, Target; | 10 import '../common/resolution.dart' show ResolutionImpact, Target; |
12 import '../constants/expressions.dart'; | 11 import '../constants/expressions.dart'; |
13 import '../dart_types.dart'; | 12 import '../dart_types.dart'; |
14 import '../diagnostics/source_span.dart'; | 13 import '../diagnostics/source_span.dart'; |
15 import '../elements/elements.dart'; | 14 import '../elements/elements.dart'; |
16 import '../tree/tree.dart'; | 15 import '../tree/tree.dart'; |
17 import '../universe/call_structure.dart' show CallStructure; | 16 import '../universe/call_structure.dart' show CallStructure; |
18 import '../universe/feature.dart'; | 17 import '../universe/feature.dart'; |
19 import '../universe/selector.dart' show Selector; | 18 import '../universe/selector.dart' show Selector; |
20 import '../universe/use.dart' show DynamicUse, StaticUse, TypeUse; | 19 import '../universe/use.dart' show DynamicUse, StaticUse, TypeUse; |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
147 sb.write('\n const-symbol-names: $_constSymbolNames'); | 146 sb.write('\n const-symbol-names: $_constSymbolNames'); |
148 } | 147 } |
149 return sb.toString(); | 148 return sb.toString(); |
150 } | 149 } |
151 } | 150 } |
152 | 151 |
153 /// [ResolutionRegistry] collects all resolution information. It stores node | 152 /// [ResolutionRegistry] collects all resolution information. It stores node |
154 /// related information in a [TreeElements] mapping and registers calls with | 153 /// related information in a [TreeElements] mapping and registers calls with |
155 /// [Backend], [World] and [Enqueuer]. | 154 /// [Backend], [World] and [Enqueuer]. |
156 // TODO(johnniwinther): Split this into an interface and implementation class. | 155 // TODO(johnniwinther): Split this into an interface and implementation class. |
157 class ResolutionRegistry extends Registry { | 156 class ResolutionRegistry { |
158 final Target target; | 157 final Target target; |
159 final TreeElementMapping mapping; | 158 final TreeElementMapping mapping; |
160 final ResolutionWorldImpactBuilder impactBuilder; | 159 final ResolutionWorldImpactBuilder impactBuilder; |
161 | 160 |
162 ResolutionRegistry(this.target, TreeElementMapping mapping) | 161 ResolutionRegistry(this.target, TreeElementMapping mapping) |
163 : this.mapping = mapping, | 162 : this.mapping = mapping, |
164 this.impactBuilder = new ResolutionWorldImpactBuilder( | 163 this.impactBuilder = new ResolutionWorldImpactBuilder( |
165 mapping.analyzedElement.toString()); | 164 mapping.analyzedElement.toString()); |
166 | 165 |
167 bool get isForResolution => true; | 166 bool get isForResolution => true; |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 @override | 428 @override |
430 void registerInstantiatedType(InterfaceType type) { | 429 void registerInstantiatedType(InterfaceType type) { |
431 registry.registerInstantiation(type); | 430 registry.registerInstantiation(type); |
432 } | 431 } |
433 | 432 |
434 @override | 433 @override |
435 DartType resolveTypeFromString(Node node, String typeName) { | 434 DartType resolveTypeFromString(Node node, String typeName) { |
436 return visitor.resolveTypeFromString(node, typeName); | 435 return visitor.resolveTypeFromString(node, typeName); |
437 } | 436 } |
438 } | 437 } |
OLD | NEW |