OLD | NEW |
---|---|
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 part of resolution; | 5 part of resolution; |
6 | 6 |
7 abstract class TreeElements { | 7 abstract class TreeElements { |
8 Element get currentElement; | 8 Element get currentElement; |
9 Set<Node> get superUses; | 9 Set<Node> get superUses; |
10 | 10 |
(...skipping 2520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2531 // TODO(ngeoffray): Remove once we remove such support. | 2531 // TODO(ngeoffray): Remove once we remove such support. |
2532 world.registerStaticUse(constructor.declaration); | 2532 world.registerStaticUse(constructor.declaration); |
2533 world.registerInstantiatedClass( | 2533 world.registerInstantiatedClass( |
2534 constructor.getEnclosingClass().declaration, mapping); | 2534 constructor.getEnclosingClass().declaration, mapping); |
2535 constructor = constructor.defaultImplementation; | 2535 constructor = constructor.defaultImplementation; |
2536 } | 2536 } |
2537 // [constructor.defaultImplementation] might be the implementation element | 2537 // [constructor.defaultImplementation] might be the implementation element |
2538 // and only declaration elements may be registered. | 2538 // and only declaration elements may be registered. |
2539 world.registerStaticUse(constructor.declaration); | 2539 world.registerStaticUse(constructor.declaration); |
2540 ClassElement cls = constructor.getEnclosingClass(); | 2540 ClassElement cls = constructor.getEnclosingClass(); |
2541 // [cls] might be the implementation element and only declaration elements | 2541 InterfaceType type = mapping.getType(node); |
2542 // may be registered. | 2542 world.registerInstantiatedType(type, mapping); |
2543 world.registerInstantiatedType(mapping.getType(node), mapping); | 2543 if (constructor.isFactoryConstructor() && !type.typeArguments.isEmpty) { |
2544 compiler.enqueuer.resolution.registerFactoryWithTypeArguments(); | |
ahe
2013/04/04 18:43:31
s/compiler.enqueuer.resolution/world/
karlklose
2013/04/08 09:45:12
Done.
| |
2545 } | |
2544 if (cls.isAbstract(compiler)) { | 2546 if (cls.isAbstract(compiler)) { |
2545 compiler.backend.registerAbstractClassInstantiation(mapping); | 2547 compiler.backend.registerAbstractClassInstantiation(mapping); |
2546 } | 2548 } |
2547 // [cls] might be the declaration element and we want to include injected | 2549 // [cls] might be the declaration element and we want to include injected |
2548 // members. | 2550 // members. |
2549 cls.implementation.forEachInstanceField( | 2551 cls.implementation.forEachInstanceField( |
2550 (ClassElement enclosingClass, Element member) { | 2552 (ClassElement enclosingClass, Element member) { |
2551 world.addToWorkList(member); | 2553 world.addToWorkList(member); |
2552 }, | 2554 }, |
2553 includeBackendMembers: false, | 2555 includeBackendMembers: false, |
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
3827 return e; | 3829 return e; |
3828 } | 3830 } |
3829 | 3831 |
3830 /// Assumed to be called by [resolveRedirectingFactory]. | 3832 /// Assumed to be called by [resolveRedirectingFactory]. |
3831 Element visitReturn(Return node) { | 3833 Element visitReturn(Return node) { |
3832 Node expression = node.expression; | 3834 Node expression = node.expression; |
3833 return finishConstructorReference(visit(expression), | 3835 return finishConstructorReference(visit(expression), |
3834 expression, expression); | 3836 expression, expression); |
3835 } | 3837 } |
3836 } | 3838 } |
OLD | NEW |