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

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

Issue 10826243: Restore lazy parsing of classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
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 | « dart/lib/compiler/implementation/compiler.dart ('k') | dart/lib/dartdoc/mirrors/dart2js_mirror.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/lib/compiler/implementation/world.dart
diff --git a/dart/lib/compiler/implementation/world.dart b/dart/lib/compiler/implementation/world.dart
index 7254d7a7f68e87537c73a78fe71b319e493d80c8..6a514ba8a144d20f3cc3da7c13d09ad4ddd66379 100644
--- a/dart/lib/compiler/implementation/world.dart
+++ b/dart/lib/compiler/implementation/world.dart
@@ -8,27 +8,20 @@ class World {
World() : subtypes = new Map<ClassElement, Set<ClassElement>>();
- void populate(Compiler compiler, Collection<LibraryElement> libraries) {
+ void populate(Compiler compiler) {
void addSubtypes(ClassElement cls) {
+ if (!cls.isResolved) {
+ compiler.internalErrorOnElement(
+ cls, 'Class "${cls.name.slowToString()}" is not resolved.');
+ }
for (Type type in cls.allSupertypes) {
- Set<Element> subtypesOfCls = subtypes.putIfAbsent(
- type.element,
- () => new Set<ClassElement>());
+ Set<Element> subtypesOfCls =
+ subtypes.putIfAbsent(type.element, () => new Set<ClassElement>());
subtypesOfCls.add(cls);
}
}
- libraries.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;
- compiler.resolveClass(cls);
- addSubtypes(cls);
- }
- });
+ compiler.resolverWorld.instantiatedClasses.forEach(addSubtypes);
// Mark the world as populated.
assert(compiler !== null);
« no previous file with comments | « dart/lib/compiler/implementation/compiler.dart ('k') | dart/lib/dartdoc/mirrors/dart2js_mirror.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698