Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(700)

Side by Side Diff: sdk/lib/_internal/compiler/implementation/dart_backend/placeholder_collector.dart

Issue 23904023: Revert r27592, some unit tests fail. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 26 matching lines...) Expand all
37 37
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 SendVisitor(collector, TreeElements elements) 47 get compiler => collector.compiler;
48 : this.collector = collector, 48
49 super(elements, collector.compiler); 49 SendVisitor(this.collector, TreeElements elements) : super(elements);
50 50
51 visitOperatorSend(Send node) { 51 visitOperatorSend(Send node) {
52 } 52 }
53 53
54 visitForeignSend(Send node) {} 54 visitForeignSend(Send node) {}
55 55
56 visitSuperSend(Send node) { 56 visitSuperSend(Send node) {
57 Element element = elements[node]; 57 Element element = elements[node];
58 if (element != null && element.isConstructor()) { 58 if (element != null && element.isConstructor()) {
59 collector.makeRedirectingConstructorPlaceholder(node.selector, element); 59 collector.makeRedirectingConstructorPlaceholder(node.selector, element);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 // in case of A(int this.f()); 97 // in case of A(int this.f());
98 if (node.selector is Identifier) { 98 if (node.selector is Identifier) {
99 collector.tryMakeLocalPlaceholder(element, node.selector); 99 collector.tryMakeLocalPlaceholder(element, node.selector);
100 } else { 100 } else {
101 assert(node.selector is FunctionExpression); 101 assert(node.selector is FunctionExpression);
102 } 102 }
103 } 103 }
104 } 104 }
105 } 105 }
106 106
107 visitAssert(node) {
108 visitStaticSend(node);
109 }
110
111 visitStaticSend(Send node) { 107 visitStaticSend(Send node) {
112 final element = elements[node]; 108 final element = elements[node];
113 collector.backend.registerStaticSend(element, node); 109 collector.backend.registerStaticSend(element, node);
114 110
115 if (Elements.isUnresolved(element) 111 if (Elements.isUnresolved(element)
116 || identical(element, compiler.assertMethod)) { 112 || identical(element, compiler.assertMethod)) {
117 return; 113 return;
118 } 114 }
119 if (element.isConstructor() || element.isFactoryConstructor()) { 115 if (element.isConstructor() || element.isFactoryConstructor()) {
120 // Rename named constructor in redirection position: 116 // Rename named constructor in redirection position:
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 622
627 visitBlock(Block node) { 623 visitBlock(Block node) {
628 for (Node statement in node.statements.nodes) { 624 for (Node statement in node.statements.nodes) {
629 if (statement is VariableDefinitions) { 625 if (statement is VariableDefinitions) {
630 makeVarDeclarationTypePlaceholder(statement); 626 makeVarDeclarationTypePlaceholder(statement);
631 } 627 }
632 } 628 }
633 node.visitChildren(this); 629 node.visitChildren(this);
634 } 630 }
635 } 631 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698