Fixes a very obscure bug in ControlFlowAnalyzer.

In TypeTightener, we create synthetic references between an instance method and its staticImpl, to guard against the case where the instance method inlines the static (thus losing the direct reference) but some call site later rebinds to the staticImpl.  Turns out, we need to do the same in CFA.

Found by: mike.aizatsky
Review by: cromwellian



git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@6532 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java b/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java
index 446a52e..f62bba9 100644
--- a/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java
+++ b/dev/core/src/com/google/gwt/dev/jjs/impl/ControlFlowAnalyzer.java
@@ -506,6 +506,19 @@
             maybeRescueJavaScriptObjectPassingIntoJava(method.getType());
           }
           rescueOverridingMethods(method);
+
+          /*
+           * Special case: also rescue an associated staticImpl. Most of the
+           * time, this would happen naturally since the instance method
+           * delegates to the static. However, in cases where the static has
+           * been inlined into the instance method, future optimization could
+           * tighten an instance call into a static call, reaching code that
+           * was pruned.
+           */
+          JMethod staticImpl = program.getStaticImpl(method);
+          if (staticImpl != null) {
+            rescue(staticImpl);
+          }
           return true;
         }
       }