Chromium Code Reviews| 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' show | 8 import '../common/backend_api.dart' show |
| 9 Backend, | 9 Backend, |
| 10 ForeignResolver; | 10 ForeignResolver; |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 import '../universe/world_impact.dart' show | 34 import '../universe/world_impact.dart' show |
| 35 WorldImpactBuilder; | 35 WorldImpactBuilder; |
| 36 import '../world.dart' show World; | 36 import '../world.dart' show World; |
| 37 | 37 |
| 38 import 'send_structure.dart'; | 38 import 'send_structure.dart'; |
| 39 | 39 |
| 40 import 'members.dart' show | 40 import 'members.dart' show |
| 41 ResolverVisitor; | 41 ResolverVisitor; |
| 42 import 'tree_elements.dart' show | 42 import 'tree_elements.dart' show |
| 43 TreeElementMapping; | 43 TreeElementMapping; |
| 44 | 44 |
|
Johnni Winther
2015/10/26 14:12:37
Moved to common/registry.dart
| |
| 45 // TODO(johnniwinther): Remove this. | |
| 46 class EagerRegistry extends Registry { | |
| 47 final Compiler compiler; | |
| 48 final TreeElementMapping mapping; | |
| 49 | |
| 50 EagerRegistry(this.compiler, this.mapping); | |
| 51 | |
| 52 ResolutionEnqueuer get world => compiler.enqueuer.resolution; | |
| 53 | |
| 54 @override | |
| 55 bool get isForResolution => true; | |
| 56 | |
| 57 @override | |
| 58 void registerDynamicGetter(UniverseSelector selector) { | |
| 59 world.registerDynamicGetter(selector); | |
| 60 } | |
| 61 | |
| 62 @override | |
| 63 void registerDynamicInvocation(UniverseSelector selector) { | |
| 64 world.registerDynamicInvocation(selector); | |
| 65 } | |
| 66 | |
| 67 @override | |
| 68 void registerDynamicSetter(UniverseSelector selector) { | |
| 69 world.registerDynamicSetter(selector); | |
| 70 } | |
| 71 | |
| 72 @override | |
| 73 void registerGetOfStaticFunction(FunctionElement element) { | |
| 74 world.registerGetOfStaticFunction(element); | |
| 75 } | |
| 76 | |
| 77 @override | |
| 78 void registerInstantiation(InterfaceType type) { | |
| 79 world.registerInstantiatedType(type); | |
| 80 } | |
| 81 | |
| 82 @override | |
| 83 void registerStaticInvocation(Element element) { | |
| 84 world.registerStaticUse(element); | |
| 85 } | |
| 86 | |
| 87 String toString() => 'EagerRegistry for ${mapping.analyzedElement}'; | |
| 88 } | |
| 89 | |
| 90 class _ResolutionWorldImpact extends ResolutionImpact with WorldImpactBuilder { | 45 class _ResolutionWorldImpact extends ResolutionImpact with WorldImpactBuilder { |
| 91 final String name; | 46 final String name; |
| 92 Setlet<Feature> _features; | 47 Setlet<Feature> _features; |
| 93 Setlet<MapLiteralUse> _mapLiterals; | 48 Setlet<MapLiteralUse> _mapLiterals; |
| 94 Setlet<ListLiteralUse> _listLiterals; | 49 Setlet<ListLiteralUse> _listLiterals; |
| 95 Setlet<String> _constSymbolNames; | 50 Setlet<String> _constSymbolNames; |
| 96 | 51 |
| 97 _ResolutionWorldImpact(this.name); | 52 _ResolutionWorldImpact(this.name); |
| 98 | 53 |
| 99 void registerMapLiteral(MapLiteralUse mapLiteralUse) { | 54 void registerMapLiteral(MapLiteralUse mapLiteralUse) { |
| (...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 576 @override | 531 @override |
| 577 void registerInstantiatedType(InterfaceType type) { | 532 void registerInstantiatedType(InterfaceType type) { |
| 578 registry.registerInstantiatedType(type); | 533 registry.registerInstantiatedType(type); |
| 579 } | 534 } |
| 580 | 535 |
| 581 @override | 536 @override |
| 582 DartType resolveTypeFromString(Node node, String typeName) { | 537 DartType resolveTypeFromString(Node node, String typeName) { |
| 583 return visitor.resolveTypeFromString(node, typeName); | 538 return visitor.resolveTypeFromString(node, typeName); |
| 584 } | 539 } |
| 585 } | 540 } |
| OLD | NEW |