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

Unified Diff: compiler/java/com/google/dart/compiler/backend/js/analysis/DependencyComputer.java

Issue 8676041: JS tree shaking for incremental builds. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: DartCompilerWarmup doesn't write files ending in *.app.js* Created 9 years 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: compiler/java/com/google/dart/compiler/backend/js/analysis/DependencyComputer.java
diff --git a/compiler/java/com/google/dart/compiler/backend/js/analysis/DependencyComputer.java b/compiler/java/com/google/dart/compiler/backend/js/analysis/DependencyComputer.java
index 52884d714f7d833b11eb338642b98b3b61704234..3a35d219a6cc8e7033fe44179ec691af17cdb6b8 100644
--- a/compiler/java/com/google/dart/compiler/backend/js/analysis/DependencyComputer.java
+++ b/compiler/java/com/google/dart/compiler/backend/js/analysis/DependencyComputer.java
@@ -64,16 +64,22 @@ class DependencyComputer {
/*
* Whenever we see an instantiation we must check it and any super type for members that
- * match the virtual names seen to date.
+ * match the virtual names seen to date and we must ensure that the corresponding inherits
+ * get emitted.
*/
while (instantiatedClass != null) {
+ JavascriptElement inheritsInvocation = instantiatedClass.getInheritsInvocation();
+ if (inheritsInvocation != null) {
+ dependencies.add(inheritsInvocation);
+ }
+
for (JavascriptElement member : instantiatedClass.getMembers()) {
if (virtualNames.contains(member.getName())) {
dependencies.add(member);
}
}
- instantiatedClass = instantiatedClass.getInherits();
+ instantiatedClass = instantiatedClass.getInheritsElement();
}
}
}

Powered by Google App Engine
This is Rietveld 408576698