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

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

Issue 10854067: Process typedefs, referenced from the program. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 4 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 class SendVisitor extends ResolvedVisitor { 5 class SendVisitor extends ResolvedVisitor {
6 final PlaceholderCollector collector; 6 final PlaceholderCollector collector;
7 7
8 SendVisitor(this.collector, TreeElements elements) : super(elements); 8 SendVisitor(this.collector, TreeElements elements) : super(elements);
9 9
10 visitSuperSend(Send node) {} 10 visitSuperSend(Send node) {}
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 tryMakePrivateIdentifier( 126 tryMakePrivateIdentifier(
127 definition.asSendSet().selector.asIdentifier()); 127 definition.asSendSet().selector.asIdentifier());
128 } else { 128 } else {
129 assert(false); // Unreachable. 129 assert(false); // Unreachable.
130 } 130 }
131 } 131 }
132 } 132 }
133 } 133 }
134 134
135 void collect(Element element, TreeElements elements) { 135 void collect(Element element, TreeElements elements) {
136 // Skip AbstractFieldElement, it has no node.
137 // Instead getters and setters should be processed explicitly.
138 if (element is AbstractFieldElement) return;
139 treeElements = elements; 136 treeElements = elements;
140 Node elementNode; 137 Node elementNode;
141 if (element is FunctionElement) { 138 if (element is FunctionElement) {
142 currentElement = element; 139 currentElement = element;
143 elementNode = currentElement.parseNode(compiler); 140 elementNode = currentElement.parseNode(compiler);
144 collectFunctionDeclarationPlaceholders(element, elementNode); 141 collectFunctionDeclarationPlaceholders(element, elementNode);
145 } else if (element.isField()) { 142 } else if (element.isField()) {
146 // TODO(smok): In the future make sure we don't process same 143 // TODO(smok): In the future make sure we don't process same
147 // variable list element twice, better merge this with emitter logic. 144 // variable list element twice, better merge this with emitter logic.
148 currentElement = element.variables; 145 currentElement = element.variables;
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 final send = node.typeName.asSend(); 219 final send = node.typeName.asSend();
223 final hasPrefix = element.lookupConstructor( 220 final hasPrefix = element.lookupConstructor(
224 send.receiver.source, send.selector.source) === null; 221 send.receiver.source, send.selector.source) === null;
225 if (!hasPrefix) target = send.receiver; 222 if (!hasPrefix) target = send.receiver;
226 } 223 }
227 } 224 }
228 makeTypePlaceholder(target, type); 225 makeTypePlaceholder(target, type);
229 node.visitChildren(this); 226 node.visitChildren(this);
230 } 227 }
231 } 228 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698