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

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

Issue 10837289: Split collecting and traversing. (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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/dart_backend/backend.dart
diff --git a/lib/compiler/implementation/dart_backend/backend.dart b/lib/compiler/implementation/dart_backend/backend.dart
index ae1ef3ab787228637eb651197cf99d5f3970c1a7..b46e190217f237b4660852eab104dc3996f9cfba 100644
--- a/lib/compiler/implementation/dart_backend/backend.dart
+++ b/lib/compiler/implementation/dart_backend/backend.dart
@@ -51,11 +51,10 @@ class DartBackend extends Backend {
Map<ClassElement, Set<Element>> classMembers =
new Map<ClassElement, Set<Element>>();
- PlaceholderCollector collector = new PlaceholderCollector(compiler);
+ // Build all top level elements to emit and necessary class members.
var newTypedefElementCallback, newClassElementCallback;
processElement(element, treeElements) {
- collector.collect(element, treeElements);
new ReferencedElementCollector(
compiler,
element, treeElements,
@@ -100,6 +99,19 @@ class DartBackend extends Backend {
}
});
+ // Create all necessary placeholders.
+ PlaceholderCollector collector = new PlaceholderCollector(compiler);
+ makePlaceholders(element) {
+ TreeElements treeElements = resolvedElements[element];
+ if (treeElements === null) treeElements = emptyTreeElements;
+ collector.collect(element, treeElements);
+ if (element is ClassElement) {
Roman 2012/08/17 08:22:28 I would prefer that class members are explicitly c
Anton Muhin 2012/08/17 08:32:41 I actually started that way, but decided eventuall
Roman 2012/08/17 08:34:24 Probably I'm wrong, but I think that some element
Anton Muhin 2012/08/17 08:38:04 Yes. Now we go over all the member elements and p
+ classMembers[element].forEach(makePlaceholders);
+ }
+ }
+ topLevelElements.forEach(makePlaceholders);
+
+ // Create renames.
Map<Node, String> renames = new Map<Node, String>();
Map<LibraryElement, String> imports = new Map<LibraryElement, String>();
renamePlaceholders(compiler, collector, renames, imports);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698