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

Unified Diff: sdk/lib/_internal/compiler/implementation/deferred_load.dart

Issue 22067002: Ignore unused classes when constructing set for deferred loading. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Cleaned up redundant code. Created 7 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 | sdk/lib/_internal/compiler/implementation/enqueue.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/deferred_load.dart
diff --git a/sdk/lib/_internal/compiler/implementation/deferred_load.dart b/sdk/lib/_internal/compiler/implementation/deferred_load.dart
index 53eca9743ed7c90cbebcf36cd64e57b6d68b5c56..4ecf03f63400e7de16f71428426cc855046a6cf2 100644
--- a/sdk/lib/_internal/compiler/implementation/deferred_load.dart
+++ b/sdk/lib/_internal/compiler/implementation/deferred_load.dart
@@ -83,21 +83,23 @@ class DeferredLoadTask extends CompilerTask {
new LinkedHashMap<LibraryElement, Set<Element>>();
Set<Element> eagerElements = new LinkedHashSet<Element>();
- // Iterate through the local members of the main script. Create
+ // Iterate through live local members of the main script. Create
// a root-set of elements that must be loaded eagerly
// (everything that is directly referred to from the main
// script, but not imported from a deferred library), as well as
// root-sets for deferred libraries.
mainApp.forEachLocalMember((Element e) {
- for (Element dependency in allElementsResolvedFrom(e)) {
- if (isExplicitlyDeferred(dependency)) {
- Set<Element> deferredElementsFromLibrary =
- deferredElements.putIfAbsent(
- dependency.getLibrary(),
- () => new LinkedHashSet<Element>());
- deferredElementsFromLibrary.add(dependency);
- } else if (dependency.getLibrary() != mainApp) {
- eagerElements.add(dependency.implementation);
+ if (compiler.enqueuer.resolution.isLive(e)) {
+ for (Element dependency in allElementsResolvedFrom(e)) {
+ if (isExplicitlyDeferred(dependency)) {
+ Set<Element> deferredElementsFromLibrary =
+ deferredElements.putIfAbsent(
+ dependency.getLibrary(),
+ () => new LinkedHashSet<Element>());
+ deferredElementsFromLibrary.add(dependency);
+ } else if (dependency.getLibrary() != mainApp) {
+ eagerElements.add(dependency.implementation);
+ }
}
}
});
« no previous file with comments | « no previous file | sdk/lib/_internal/compiler/implementation/enqueue.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698