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/backend_api.dart' show | 7 import '../common/backend_api.dart' show |
8 Backend; | 8 Backend; |
9 import '../common/registry.dart' show | 9 import '../common/registry.dart' show |
10 Registry; | 10 Registry; |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 void registerInstantiation(InterfaceType type) { | 87 void registerInstantiation(InterfaceType type) { |
88 // TODO(johnniwinther): Remove the need for passing `this`. | 88 // TODO(johnniwinther): Remove the need for passing `this`. |
89 world.registerInstantiatedType(type, this); | 89 world.registerInstantiatedType(type, this); |
90 } | 90 } |
91 | 91 |
92 @override | 92 @override |
93 void registerStaticInvocation(Element element) { | 93 void registerStaticInvocation(Element element) { |
94 registerDependency(element); | 94 registerDependency(element); |
95 world.registerStaticUse(element); | 95 world.registerStaticUse(element); |
96 } | 96 } |
97 | |
98 String toString() => 'EagerRegistry for ${mapping.analyzedElement}'; | |
99 } | 97 } |
100 | 98 |
101 class ResolutionWorldImpact implements WorldImpact { | 99 class ResolutionWorldImpact implements WorldImpact { |
102 final Registry registry; | 100 final Registry registry; |
103 Setlet<UniverseSelector> _dynamicInvocations; | 101 Setlet<UniverseSelector> _dynamicInvocations; |
104 Setlet<UniverseSelector> _dynamicGetters; | 102 Setlet<UniverseSelector> _dynamicGetters; |
105 Setlet<UniverseSelector> _dynamicSetters; | 103 Setlet<UniverseSelector> _dynamicSetters; |
106 Setlet<InterfaceType> _instantiatedTypes; | 104 Setlet<InterfaceType> _instantiatedTypes; |
107 Setlet<Element> _staticUses; | 105 Setlet<Element> _staticUses; |
108 Setlet<DartType> _checkedTypes; | 106 Setlet<DartType> _checkedTypes; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 this.worldImpact = new ResolutionWorldImpact(compiler, mapping); | 215 this.worldImpact = new ResolutionWorldImpact(compiler, mapping); |
218 | 216 |
219 bool get isForResolution => true; | 217 bool get isForResolution => true; |
220 | 218 |
221 ResolutionEnqueuer get world => compiler.enqueuer.resolution; | 219 ResolutionEnqueuer get world => compiler.enqueuer.resolution; |
222 | 220 |
223 World get universe => compiler.world; | 221 World get universe => compiler.world; |
224 | 222 |
225 Backend get backend => compiler.backend; | 223 Backend get backend => compiler.backend; |
226 | 224 |
227 String toString() => 'ResolutionRegistry for ${mapping.analyzedElement}'; | |
228 | |
229 ////////////////////////////////////////////////////////////////////////////// | 225 ////////////////////////////////////////////////////////////////////////////// |
230 // Node-to-Element mapping functionality. | 226 // Node-to-Element mapping functionality. |
231 ////////////////////////////////////////////////////////////////////////////// | 227 ////////////////////////////////////////////////////////////////////////////// |
232 | 228 |
233 /// Register [node] as the declaration of [element]. | 229 /// Register [node] as the declaration of [element]. |
234 void defineFunction(FunctionExpression node, FunctionElement element) { | 230 void defineFunction(FunctionExpression node, FunctionElement element) { |
235 // TODO(sigurdm): Remove when not needed by the dart2dart backend. | 231 // TODO(sigurdm): Remove when not needed by the dart2dart backend. |
236 if (node.name != null) { | 232 if (node.name != null) { |
237 mapping[node.name] = element; | 233 mapping[node.name] = element; |
238 } | 234 } |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 } | 606 } |
611 | 607 |
612 void registerIncDecOperation() { | 608 void registerIncDecOperation() { |
613 backend.resolutionCallbacks.onIncDecOperation(this); | 609 backend.resolutionCallbacks.onIncDecOperation(this); |
614 } | 610 } |
615 | 611 |
616 void registerTryStatement() { | 612 void registerTryStatement() { |
617 mapping.containsTryStatement = true; | 613 mapping.containsTryStatement = true; |
618 } | 614 } |
619 } | 615 } |
OLD | NEW |