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

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

Issue 10383065: Start creating a MemberSet abstraction, and use it to fold getters/setters into field accesses. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 7 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
Index: lib/compiler/implementation/compiler.dart
===================================================================
--- lib/compiler/implementation/compiler.dart (revision 7416)
+++ lib/compiler/implementation/compiler.dart (working copy)
@@ -300,6 +300,7 @@
});
}
native.processNativeClasses(this, universe.libraries.getValues());
+ computeSubclasses();
enqueue(new WorkItem.toCompile(main));
codegenProgress.reset();
while (!worklist.isEmpty()) {
@@ -316,6 +317,29 @@
}
}
+ void addSubtypes(ClassElement cls) {
+ for (Type type in cls.allSupertypes) {
+ List<Element> subtypes = universe.subtypes.putIfAbsent(
+ type.element,
+ () => <ClassElement>[]);
+ subtypes.add(cls);
+ }
+ }
+
+ void computeSubclasses() {
+ universe.libraries.getValues().forEach((LibraryElement library) {
+ for (Link<Element> link = library.topLevelElements;
+ !link.isEmpty();
+ link = link.tail) {
+ Element element = link.head;
+ if (!element.isClass()) continue;
+ ClassElement cls = element;
+ resolveClass(cls);
+ addSubtypes(cls);
+ }
+ });
+ }
+
TreeElements analyzeElement(Element element) {
assert(parser !== null);
Node tree = parser.parse(element);
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/builder.dart » ('j') | lib/compiler/implementation/ssa/nodes.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698