| 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 dart_backend; | 5 part of dart_backend; |
| 6 | 6 |
| 7 class LocalPlaceholder { | 7 class LocalPlaceholder { |
| 8 final String identifier; | 8 final String identifier; |
| 9 final Set<Node> nodes; | 9 final Set<Node> nodes; |
| 10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); | 10 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 class DeclarationTypePlaceholder { | 38 class DeclarationTypePlaceholder { |
| 39 final TypeAnnotation typeNode; | 39 final TypeAnnotation typeNode; |
| 40 final bool requiresVar; | 40 final bool requiresVar; |
| 41 DeclarationTypePlaceholder(this.typeNode, this.requiresVar); | 41 DeclarationTypePlaceholder(this.typeNode, this.requiresVar); |
| 42 } | 42 } |
| 43 | 43 |
| 44 class SendVisitor extends ResolvedVisitor { | 44 class SendVisitor extends ResolvedVisitor { |
| 45 final PlaceholderCollector collector; | 45 final PlaceholderCollector collector; |
| 46 | 46 |
| 47 get compiler => collector.compiler; | 47 get compiler => collector.compiler; |
| 48 DartBackend get backend => compiler.backend; |
| 48 | 49 |
| 49 SendVisitor(this.collector, TreeElements elements) : super(elements); | 50 SendVisitor(this.collector, TreeElements elements) : super(elements); |
| 50 | 51 |
| 51 visitOperatorSend(Send node) { | 52 visitOperatorSend(Send node) { |
| 52 } | 53 } |
| 53 | 54 |
| 54 visitForeignSend(Send node) {} | 55 visitForeignSend(Send node) {} |
| 55 | 56 |
| 56 visitSuperSend(Send node) { | 57 visitSuperSend(Send node) { |
| 57 Element element = elements[node]; | 58 Element element = elements[node]; |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 collector.tryMakeLocalPlaceholder(element, node.selector); | 100 collector.tryMakeLocalPlaceholder(element, node.selector); |
| 100 } else { | 101 } else { |
| 101 assert(node.selector is FunctionExpression); | 102 assert(node.selector is FunctionExpression); |
| 102 } | 103 } |
| 103 } | 104 } |
| 104 } | 105 } |
| 105 } | 106 } |
| 106 | 107 |
| 107 visitStaticSend(Send node) { | 108 visitStaticSend(Send node) { |
| 108 final element = elements[node]; | 109 final element = elements[node]; |
| 110 backend.registerStaticSend(element, node); |
| 111 |
| 109 if (Elements.isUnresolved(element) | 112 if (Elements.isUnresolved(element) |
| 110 || identical(element, compiler.assertMethod)) { | 113 || identical(element, compiler.assertMethod)) { |
| 111 return; | 114 return; |
| 112 } | 115 } |
| 113 if (element.isConstructor() || element.isFactoryConstructor()) { | 116 if (element.isConstructor() || element.isFactoryConstructor()) { |
| 114 // Rename named constructor in redirection position: | 117 // Rename named constructor in redirection position: |
| 115 // class C { C.named(); C.redirecting() : this.named(); } | 118 // class C { C.named(); C.redirecting() : this.named(); } |
| 116 if (node.receiver is Identifier | 119 if (node.receiver is Identifier |
| 117 && node.receiver.asIdentifier().isThis()) { | 120 && node.receiver.asIdentifier().isThis()) { |
| 118 assert(node.selector is Identifier); | 121 assert(node.selector is Identifier); |
| (...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 615 | 618 |
| 616 visitBlock(Block node) { | 619 visitBlock(Block node) { |
| 617 for (Node statement in node.statements.nodes) { | 620 for (Node statement in node.statements.nodes) { |
| 618 if (statement is VariableDefinitions) { | 621 if (statement is VariableDefinitions) { |
| 619 makeVarDeclarationTypePlaceholder(statement); | 622 makeVarDeclarationTypePlaceholder(statement); |
| 620 } | 623 } |
| 621 } | 624 } |
| 622 node.visitChildren(this); | 625 node.visitChildren(this); |
| 623 } | 626 } |
| 624 } | 627 } |
| OLD | NEW |