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