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

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

Issue 10868020: [dart2dart] In renamer only add import prefix for top-level elements. (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
« no previous file with comments | « no previous file | lib/compiler/implementation/dart_backend/renamer.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 LocalPlaceholder implements Hashable { 5 class LocalPlaceholder implements Hashable {
6 final String identifier; 6 final String identifier;
7 final Set<Node> nodes; 7 final Set<Node> nodes;
8 LocalPlaceholder(this.identifier) : nodes = new Set<Node>(); 8 LocalPlaceholder(this.identifier) : nodes = new Set<Node>();
9 int hashCode() => identifier.hashCode(); 9 int hashCode() => identifier.hashCode();
10 String toString() => 10 String toString() =>
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 void makeNullPlaceholder(Node node) { 199 void makeNullPlaceholder(Node node) {
200 assert(node is Identifier || node is Send); 200 assert(node is Identifier || node is Send);
201 nullNodes.add(node); 201 nullNodes.add(node);
202 } 202 }
203 203
204 void makeElementPlaceholder(Node node, Element element) { 204 void makeElementPlaceholder(Node node, Element element) {
205 assert(element !== null); 205 assert(element !== null);
206 if (element === entryFunction) return; 206 if (element === entryFunction) return;
207 if (element.getLibrary() === coreLibrary) return; 207 if (element.getLibrary() === coreLibrary) return;
208 if (isDartCoreLib(compiler, element.getLibrary())
209 && !element.isTopLevel()) {
210 return;
211 }
208 if (element == compiler.types.dynamicType.element) { 212 if (element == compiler.types.dynamicType.element) {
209 internalError( 213 internalError(
210 'Should never make element placeholder for dynamic type element', 214 'Should never make element placeholder for dynamic type element',
211 node); 215 node);
212 } 216 }
213 elementNodes.putIfAbsent(element, () => new Set<Node>()).add(node); 217 elementNodes.putIfAbsent(element, () => new Set<Node>()).add(node);
214 } 218 }
215 219
216 void makePrivateIdentifier(Identifier node) { 220 void makePrivateIdentifier(Identifier node) {
217 assert(node !== null); 221 assert(node !== null);
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 } 411 }
408 node.visitChildren(this); 412 node.visitChildren(this);
409 } 413 }
410 414
411 visitTypedef(Typedef node) { 415 visitTypedef(Typedef node) {
412 assert(currentElement is TypedefElement); 416 assert(currentElement is TypedefElement);
413 makeElementPlaceholder(node.name, currentElement); 417 makeElementPlaceholder(node.name, currentElement);
414 node.visitChildren(this); 418 node.visitChildren(this);
415 } 419 }
416 } 420 }
OLDNEW
« no previous file with comments | « no previous file | lib/compiler/implementation/dart_backend/renamer.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698