We were failing to staticify certain call sites simply because no new static impl methods are created. Found by:andres.a.testi Review by: spoon (postmortem) git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@3133 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/MakeCallsStatic.java b/dev/core/src/com/google/gwt/dev/jjs/impl/MakeCallsStatic.java index a5df81d..7e5e399 100644 --- a/dev/core/src/com/google/gwt/dev/jjs/impl/MakeCallsStatic.java +++ b/dev/core/src/com/google/gwt/dev/jjs/impl/MakeCallsStatic.java
@@ -158,7 +158,7 @@ } // Set the new original param types based on the old original param types - List<JType> originalParamTypes = new ArrayList<JType>(); + List<JType> originalParamTypes = new ArrayList<JType>(); originalParamTypes.add(enclosingType); originalParamTypes.addAll(x.getOriginalParamTypes()); newMethod.setOriginalParamTypes(originalParamTypes); @@ -302,19 +302,21 @@ private boolean execImpl() { FindStaticDispatchSitesVisitor finder = new FindStaticDispatchSitesVisitor(); finder.accept(program); - if (toBeMadeStatic.isEmpty()) { - return false; - } CreateStaticImplsVisitor creator = new CreateStaticImplsVisitor(); for (JMethod method : toBeMadeStatic) { creator.accept(method); } + /* + * Run the rewriter even if we didn't make any new static methods; other + * optimizations can unlock devirtualizations even if no more static impls + * are created. + */ RewriteCallSites rewriter = new RewriteCallSites(); rewriter.accept(program); - assert (rewriter.didChange()); - return true; + assert (rewriter.didChange() || toBeMadeStatic.isEmpty()); + return rewriter.didChange(); } }