Fixed a bug resulting from the interaction between parameter pruning and devirtualization. Parameters in static impl methods may no longer be pruned until the corresponding instance method is dead.
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@1510 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/Pruner.java b/dev/core/src/com/google/gwt/dev/jjs/impl/Pruner.java
index 5d2c92b..8a46fcc 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/impl/Pruner.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/impl/Pruner.java
@@ -250,6 +250,21 @@
return true;
}
+ /*
+ * We cannot prune parameters from staticImpls that still have a live
+ * instance method, because doing so would screw up any subsequent
+ * devirtualizations. If the instance method has been pruned, then it's
+ * okay. Also, it's okay on the final pass since no more
+ * devirtualizations will occur.
+ */
+ JMethod staticImplFor = program.staticImplFor(x);
+ // Unless the instance method has already been pruned, of course.
+ if (saveCodeGenTypes && staticImplFor != null
+ && staticImplFor.getEnclosingType().methods.contains(staticImplFor)) {
+ // instance method is still live
+ return true;
+ }
+
JsFunction func = x.isNative()
? ((JsniMethodBody) x.getBody()).getFunc() : null;