Revision: 7875
Author: [email protected]
Date: Sat Apr  3 06:52:10 2010
Log: Rename JTypeOracle.computeHasClinitTarget() -> JTypeOracle.computeClinitTarget().

See: r7868
Suggested by: spoon
http://gwt-code-reviews.appspot.com/184802/show
Review by: spoon

http://code.google.com/p/google-web-toolkit/source/detail?r=7875

Modified:
 /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java

=======================================
--- /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java Fri Apr 2 12:42:00 2010 +++ /trunk/dev/core/src/com/google/gwt/dev/jjs/ast/JTypeOracle.java Sat Apr 3 06:52:10 2010
@@ -596,7 +596,7 @@
   public void recomputeAfterOptimizations() {
     Set<JDeclaredType> computed = new IdentityHashSet<JDeclaredType>();
     for (JDeclaredType type : program.getDeclaredTypes()) {
-      computeHasClinitTarget(type, computed);
+      computeClinitTarget(type, computed);
     }
   }

@@ -609,33 +609,7 @@
     getOrCreate(map, key).add(value);
   }

-  /**
- * Compute all of the things I might conceivably implement, either through
-   * super types or sub types.
-   */
-  private void computeCouldImplement(JClassType type) {
- Set<JInterfaceType> couldImplementSet = new IdentityHashSet<JInterfaceType>();
-    // all of my direct implements are trivially true
-    couldImplementSet.addAll(get(implementsMap, type));
-    List<JClassType> subclasses = new ArrayList<JClassType>();
-    subclasses.addAll(get(subClassMap, type));
-    for (JClassType subclass : subclasses) {
-      for (JInterfaceType intf : subclass.getImplements()) {
-        couldImplementSet.add(intf);
-        for (JInterfaceType isup : get(superInterfaceMap, intf)) {
-          couldImplementSet.add(isup);
-        }
-      }
-    }
-    if (!couldImplementSet.isEmpty()) {
- couldImplementMap.put(type, IdentitySets.normalize(couldImplementSet));
-      for (JInterfaceType couldImpl : couldImplementSet) {
-        add(couldBeImplementedMap, couldImpl, type);
-      }
-    }
-  }
-
-  private void computeHasClinitTarget(JDeclaredType type,
+  private void computeClinitTarget(JDeclaredType type,
       Set<JDeclaredType> computed) {
     if (!type.hasClinit() || computed.contains(type)) {
       return;
@@ -646,21 +620,21 @@
* possible target; this ensures if we're tightened as well it's to the
        * transitively tightest target.
        */
-      computeHasClinitTarget(type.getSuperClass(), computed);
+      computeClinitTarget(type.getSuperClass(), computed);
     }
     if (type.getClinitTarget() != type) {
       // I already have a trivial clinit, just follow my super chain.
       type.setClinitTarget(type.getSuperClass().getClinitTarget());
     } else {
       // I still have a real clinit, actually compute.
- JDeclaredType target = computeHasClinitTargetRecursive(type, computed,
+      JDeclaredType target = computeClinitTargetRecursive(type, computed,
           new IdentityHashSet<JDeclaredType>());
       type.setClinitTarget(target);
     }
     computed.add(type);
   }

-  private JDeclaredType computeHasClinitTargetRecursive(JDeclaredType type,
+  private JDeclaredType computeClinitTargetRecursive(JDeclaredType type,
       Set<JDeclaredType> computed, Set<JDeclaredType> alreadySeen) {
     // Track that we've been seen.
     alreadySeen.add(type);
@@ -703,7 +677,7 @@
         continue;
       }

- if (computeHasClinitTargetRecursive(target, computed, alreadySeen) != null) { + if (computeClinitTargetRecursive(target, computed, alreadySeen) != null) {
         // Calling a non-empty clinit means I am a real clinit.
         return type;
       } else {
@@ -713,6 +687,32 @@
     }
     return null;
   }
+
+  /**
+ * Compute all of the things I might conceivably implement, either through
+   * super types or sub types.
+   */
+  private void computeCouldImplement(JClassType type) {
+ Set<JInterfaceType> couldImplementSet = new IdentityHashSet<JInterfaceType>();
+    // all of my direct implements are trivially true
+    couldImplementSet.addAll(get(implementsMap, type));
+    List<JClassType> subclasses = new ArrayList<JClassType>();
+    subclasses.addAll(get(subClassMap, type));
+    for (JClassType subclass : subclasses) {
+      for (JInterfaceType intf : subclass.getImplements()) {
+        couldImplementSet.add(intf);
+        for (JInterfaceType isup : get(superInterfaceMap, intf)) {
+          couldImplementSet.add(isup);
+        }
+      }
+    }
+    if (!couldImplementSet.isEmpty()) {
+ couldImplementMap.put(type, IdentitySets.normalize(couldImplementSet));
+      for (JInterfaceType couldImpl : couldImplementSet) {
+        add(couldBeImplementedMap, couldImpl, type);
+      }
+    }
+  }

   /**
    * Compute all of the things I implement directly, through super types.

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

To unsubscribe, reply using "remove me" as the subject.

Reply via email to