running on some benchmarks....
authorbdemsky <bdemsky>
Fri, 11 Mar 2011 07:34:02 +0000 (07:34 +0000)
committerbdemsky <bdemsky>
Fri, 11 Mar 2011 07:34:02 +0000 (07:34 +0000)
Robust/src/Analysis/Pointer/GraphManip.java
Robust/src/Analysis/Pointer/Pointer.java

index 163e958146a517f51103635ca209d526a5d811c6..73fde38bf71aa3bb305a31585905a465b01d0e40 100644 (file)
@@ -148,7 +148,7 @@ public class GraphManip {
        MySet<Edge> edges=entry.getValue();
        MySet<Edge> removeedges=delta.heapedgeremove.get(node);
        for(Edge e:edges) {
-         if (!removeedges.contains(e)) {
+         if (removeedges==null||!removeedges.contains(e)) {
            newedges.add(e);
          }
        }
index 860dfb77a60433cdc0a7d27d836f1516c45ee15b..98e0512aa83e5fa7ae6617ad5b81dc72869633a9 100644 (file)
@@ -63,15 +63,11 @@ public class Pointer {
       BBlock bblock=ppoint.getBBlock();
       Vector<FlatNode> nodes=bblock.nodes();
       int startindex=0;
-      System.out.println("BB BEGIN");
-      delta.print();
 
       if (ppoint.getIndex()==-1) {
        //Build base graph for entrance to this basic block
-       System.out.println("INIT");
        delta=applyInitDelta(delta, bblock);
       } else {
-       System.out.println("CALL");
        startindex=ppoint.getIndex()+1;
        delta=applyCallDelta(delta, bblock);
       }
@@ -80,8 +76,6 @@ public class Pointer {
       //Compute delta at exit of each node
       for(int i=startindex; i<nodes.size();i++) {
        FlatNode currNode=nodes.get(i);
-       System.out.println(currNode);
-       delta.print();
 
        if (!graphMap.containsKey(currNode)) {
          graphMap.put(currNode, new Graph(graph));
@@ -89,27 +83,27 @@ public class Pointer {
        nodeGraph=graphMap.get(currNode);
        delta=processNode(bblock, i, currNode, delta, nodeGraph);
       }
-      System.out.println("LOOPEXIT");
-      delta.print();
       generateFinalDelta(bblock, delta, nodeGraph);
     }
 
     //DEBUG
-    int debugindex=0;
-    for(Map.Entry<BBlock, Graph> e:bbgraphMap.entrySet()) {
-      Graph g=e.getValue();
-      plotGraph(g,"BB"+debugindex);
-      debugindex++;
-    }
-
-    for(Map.Entry<FlatNode, Graph> e:graphMap.entrySet()) {
-      FlatNode fn=e.getKey();
-      Graph g=e.getValue();
-      plotGraph(g,"FN"+fn.toString()+debugindex);
-      debugindex++;
-    }
-    for(FlatMethod fm:blockMap.keySet()) {
-      fm.printMethod();
+    if (false) {
+      int debugindex=0;
+      for(Map.Entry<BBlock, Graph> e:bbgraphMap.entrySet()) {
+       Graph g=e.getValue();
+       plotGraph(g,"BB"+debugindex);
+       debugindex++;
+      }
+      
+      for(Map.Entry<FlatNode, Graph> e:graphMap.entrySet()) {
+       FlatNode fn=e.getKey();
+       Graph g=e.getValue();
+       plotGraph(g,"FN"+fn.toString()+debugindex);
+       debugindex++;
+      }
+      for(FlatMethod fm:blockMap.keySet()) {
+       fm.printMethod();
+      }
     }
   }
 
@@ -188,7 +182,6 @@ public class Pointer {
       HashSet<TempDescriptor> tmpSet=new HashSet<TempDescriptor>();
       tmpSet.addAll(delta.basevaredge.keySet());
       tmpSet.addAll(delta.varedgeadd.keySet());
-      System.out.println(tmpSet);
       for(TempDescriptor tmp:tmpSet) {
        /* Start with the new incoming edges */
        MySet<Edge> newbaseedge=delta.basevaredge.get(tmp);
@@ -250,8 +243,6 @@ public class Pointer {
        }
       }
     }
-    System.out.println("FINAL");
-    newDelta.print();
 
     /* Now we need to propagate newdelta */
     if (!newDelta.heapedgeadd.isEmpty()||!newDelta.heapedgeremove.isEmpty()||!newDelta.varedgeadd.isEmpty()||!newDelta.addNodeAges.isEmpty()||!newDelta.addOldNodes.isEmpty()) {
@@ -304,12 +295,11 @@ public class Pointer {
     case FKind.FlatExit:
     case FKind.FlatBackEdge:
     case FKind.FlatGenReachNode:
+    case FKind.FlatSESEEnterNode:
+    case FKind.FlatSESEExitNode:
       return processFlatNop(node, delta, newgraph);
     case FKind.FlatCall:
       return processFlatCall(bblock, index, (FlatCall) node, delta, newgraph);
-    case FKind.FlatSESEEnterNode:
-    case FKind.FlatSESEExitNode:
-      throw new Error("Unimplemented node:"+node);
     default:
       throw new Error("Unrecognized node:"+node);
     }
@@ -1062,7 +1052,8 @@ public class Pointer {
        MySet<Edge> edgeAdd=delta.heapedgeadd.get(src);
        MySet<Edge> existingEdges=graph.getEdges(src);
        //remove edge from delta
-       edgeAdd.remove(e);
+       if (edgeAdd!=null)
+         edgeAdd.remove(e);
        //if the edge is already in the graph, add an explicit remove to the delta
        if (existingEdges.contains(e)) {
          delta.removeHeapEdge(e);