all fixed...
[IRC.git] / Robust / src / Analysis / SSJava / LocationInference.java
index a19f725ef5f7222dbe6f97a1bd745d4a08236762..e951c1a970e7b0214c2f7649184dbc0207d76d2a 100644 (file)
@@ -1030,7 +1030,7 @@ public class LocationInference {
     while (!methodDescList.isEmpty()) {
       MethodDescriptor md = methodDescList.removeLast();
 
-      // System.out.println("\n#updateCompositeLocationAssignments=" + md);
+      System.out.println("\n#updateCompositeLocationAssignments=" + md);
 
       FlowGraph flowGraph = getFlowGraph(md);
 
@@ -1039,12 +1039,12 @@ public class LocationInference {
       Set<FlowNode> nodeSet = flowGraph.getNodeSet();
       for (Iterator iterator = nodeSet.iterator(); iterator.hasNext();) {
         FlowNode node = (FlowNode) iterator.next();
-        // System.out.println("-node=" + node + "   node.getDescTuple=" + node.getDescTuple());
+        System.out.println("-node=" + node + "   node.getDescTuple=" + node.getDescTuple());
         if (node.getCompositeLocation() != null) {
           CompositeLocation compLoc = node.getCompositeLocation();
           CompositeLocation updatedCompLoc = updateCompositeLocation(compLoc);
           node.setCompositeLocation(updatedCompLoc);
-          // System.out.println("---updatedCompLoc1=" + updatedCompLoc);
+          System.out.println("---updatedCompLoc1=" + updatedCompLoc);
         } else {
           NTuple<Descriptor> descTuple = node.getDescTuple();
           // System.out.println("update desc=" + descTuple);
@@ -1086,8 +1086,8 @@ public class LocationInference {
         HierarchyGraph scGraph = getSimpleHierarchyGraph(enclosingDesc);
         if (scGraph != null) {
           HNode curNode = scGraph.getCurrentHNode(nodeIdentifier);
-          // System.out.println("nodeID=" + nodeIdentifier + " curNode=" + curNode
-          // + "  enclosingDesc=" + enclosingDesc);
+          System.out.println("     nodeID=" + nodeIdentifier + " curNode=" + curNode
+              + "  enclosingDesc=" + enclosingDesc);
           if (curNode != null) {
             nodeIdentifier = curNode.getName();
           }
@@ -1773,6 +1773,12 @@ public class LocationInference {
             globalFlowGraph.addMapLocationToInferCompositeLocation(targetLocalLoc, newCompLoc);
             // }
 
+            // if (node.getLocTuple().get(0).getDescriptor().getSymbol().equals("get_scale_factors")
+            // || node.getLocTuple().get(0).getDescriptor().getSymbol()
+            // .equals("get_LSF_scale_data")){
+            // Set<GlobalFlowNode> debugInNodeSet =
+            // globalFlowGraph.debug_getIncomingNodeSetFromPrefix(node, curPrefix);
+            // }
             continue next;
             // }
 
@@ -2628,6 +2634,7 @@ public class LocationInference {
     lattice.removeRedundantEdges();
 
     LocationInference.numLocationsSInfer += lattice.getKeySet().size();
+    System.out.println(desc + " numPaths=" + lattice.countPaths());
 
     if (desc instanceof ClassDescriptor) {
       // field lattice
@@ -2766,6 +2773,7 @@ public class LocationInference {
       HierarchyGraph simpleHierarchyGraph = getHierarchyGraph(desc).clone();
       simpleHierarchyGraph.setName(desc + "_SIMPLE");
       simpleHierarchyGraph.removeRedundantEdges();
+      // simpleHierarchyGraph.removeIsolatedNodes();
       mapDescriptorToSimpleHierarchyGraph.put(desc, simpleHierarchyGraph);
     }
   }
@@ -3196,6 +3204,7 @@ public class LocationInference {
         // if the srcNode is started with the global descriptor
         // need to set as a skeleton node
         if (!hasGlobalAccess && srcNode.getDescTuple().startsWith(GLOBALDESC)) {
+          System.out.println("SRCNODE=" + srcNode);
           hasGlobalAccess = true;
         }
 
@@ -3307,8 +3316,8 @@ public class LocationInference {
     // set hasGloabalAccess true in the method summary.
     if (hasGlobalAccess) {
       getMethodSummary(md).setHasGlobalAccess();
+      methodGraph.getHNode(GLOBALDESC).setSkeleton(true);
     }
-    methodGraph.getHNode(GLOBALDESC).setSkeleton(true);
 
     if (ssjava.getMethodContainingSSJavaLoop().equals(md)) {
       // if the current method contains the event loop