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

Unified Diff: lib/compiler/implementation/dart_backend/placeholder_collector.dart

Issue 10827424: Do not create placeholders for elements that won't be later renamed. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/compiler/implementation/dart_backend/renamer.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/dart_backend/placeholder_collector.dart
diff --git a/lib/compiler/implementation/dart_backend/placeholder_collector.dart b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
index e4813c71903645dea9d6e8e612ea50e4205624be..87065c14a8d24c32809ce91d5d3cf1d5f009a26d 100644
--- a/lib/compiler/implementation/dart_backend/placeholder_collector.dart
+++ b/lib/compiler/implementation/dart_backend/placeholder_collector.dart
@@ -98,6 +98,9 @@ class PlaceholderCollector extends AbstractVisitor {
Element currentElement;
TreeElements treeElements;
+ LibraryElement get coreLibrary => compiler.coreLibrary;
+ FunctionElement get entryFunction => compiler.mainApp.find(Compiler.MAIN);
+
PlaceholderCollector(this.compiler) :
nullNodes = new Set<Node>(),
unresolvedNodes = new Set<Identifier>(),
@@ -257,6 +260,8 @@ class PlaceholderCollector extends AbstractVisitor {
void makeElementPlaceholder(Node node, Element element) {
assert(element !== null);
+ if (element === entryFunction) return;
Roman 2012/08/21 07:44:58 This is not the problem of your CL, but we should
Anton Muhin 2012/08/21 09:16:54 Good point, I'll fix it. On 2012/08/21 07:44:58,
+ if (element.getLibrary() === coreLibrary) return;
elementNodes.putIfAbsent(element, () => new Set<Node>()).add(node);
}
« 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