fix dumb bug in test case, add graphing option
authorjjenista <jjenista>
Tue, 9 Sep 2008 20:33:32 +0000 (20:33 +0000)
committerjjenista <jjenista>
Tue, 9 Sep 2008 20:33:32 +0000 (20:33 +0000)
Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java
Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java
Robust/src/Tests/OwnershipAnalysisTest/test01/makefile
Robust/src/Tests/OwnershipAnalysisTest/test01/test01.java

index 6078c16637950aeae768834454a8c44254db261a..be78a4993d0ec1a5951efec6cd0d5245b9198a12 100644 (file)
@@ -636,18 +636,19 @@ public class OwnershipAnalysis {
     // boolean labelSelect,
     // boolean pruneGarbage,
     // boolean writeReferencers
+    // boolean writeParamMappings
 
     if( writeDOTs ) {
 
       if( !writeAllDOTs ) {
-       og.writeGraph(d, true, true, true, false);
+       og.writeGraph(d, true, true, true, false, false);
 
       } else {
        if( !mapDescriptorToNumUpdates.containsKey(d) ) {
          mapDescriptorToNumUpdates.put(d, new Integer(0) );
        }
        Integer n = mapDescriptorToNumUpdates.get(d);
-       og.writeGraph(d, n, true, true, true, false);
+       og.writeGraph(d, n, true, true, true, false, false);
        mapDescriptorToNumUpdates.put(d, n + 1);
       }
     }
index 9f8f39505b5e227a0fc55cd331af06170a0075e2..1d3c2333c1e65fa2efde6051d18bedd98bba9e96 100644 (file)
@@ -2520,7 +2520,8 @@ public class OwnershipGraph {
                          boolean writeLabels,
                          boolean labelSelect,
                          boolean pruneGarbage,
-                         boolean writeReferencers
+                         boolean writeReferencers,
+                        boolean writeParamMappings
                          ) throws java.io.IOException {
     writeGraph(
       methodDesc.getSymbol() +
@@ -2529,7 +2530,8 @@ public class OwnershipGraph {
       writeLabels,
       labelSelect,
       pruneGarbage,
-      writeReferencers
+      writeReferencers,
+      writeParamMappings
       );
   }
 
@@ -2537,14 +2539,16 @@ public class OwnershipGraph {
                          boolean writeLabels,
                          boolean labelSelect,
                          boolean pruneGarbage,
-                         boolean writeReferencers
+                         boolean writeReferencers,
+                        boolean writeParamMappings
                          ) throws java.io.IOException {
 
     writeGraph(methodDesc+"COMPLETE",
                writeLabels,
                labelSelect,
                pruneGarbage,
-               writeReferencers
+               writeReferencers,
+              writeParamMappings
                );
   }
 
@@ -2553,14 +2557,16 @@ public class OwnershipGraph {
                          boolean writeLabels,
                          boolean labelSelect,
                          boolean pruneGarbage,
-                         boolean writeReferencers
+                         boolean writeReferencers,
+                        boolean writeParamMappings
                          ) throws java.io.IOException {
 
     writeGraph(methodDesc+"COMPLETE"+String.format("%05d", numUpdate),
                writeLabels,
                labelSelect,
                pruneGarbage,
-               writeReferencers
+               writeReferencers,
+              writeParamMappings
                );
   }
 
@@ -2568,7 +2574,8 @@ public class OwnershipGraph {
                          boolean writeLabels,
                          boolean labelSelect,
                          boolean pruneGarbage,
-                         boolean writeReferencers
+                         boolean writeReferencers,
+                        boolean writeParamMappings
                          ) throws java.io.IOException {
 
     // remove all non-word characters from the graph name so
@@ -2577,7 +2584,6 @@ public class OwnershipGraph {
 
     BufferedWriter bw = new BufferedWriter(new FileWriter(graphName+".dot") );
     bw.write("digraph "+graphName+" {\n");
-    //bw.write( "  size=\"7.5,10\";\n" );
 
     HashSet<HeapRegionNode> visited = new HashSet<HeapRegionNode>();
 
@@ -2601,13 +2607,15 @@ public class OwnershipGraph {
 
     bw.write("  graphTitle[label=\""+graphName+"\",shape=box];\n");
 
-    Set df = paramIndex2id.entrySet();
-    Iterator ih = df.iterator();
-    while( ih.hasNext() ) {
-      Map.Entry meh = (Map.Entry)ih.next();
-      Integer pi = (Integer) meh.getKey();
-      Integer id = (Integer) meh.getValue();
-      bw.write("  pindex"+pi+"[label=\""+pi+" to "+id+"\",shape=box];\n");
+    if( writeParamMappings ) {
+      Set df = paramIndex2id.entrySet();
+      Iterator ih = df.iterator();
+      while( ih.hasNext() ) {
+       Map.Entry meh = (Map.Entry)ih.next();
+       Integer pi = (Integer) meh.getKey();
+       Integer id = (Integer) meh.getValue();
+       bw.write("  pindex"+pi+"[label=\""+pi+" to "+id+"\",shape=box];\n");
+      }
     }
 
     // then visit every label node, useful for debugging
index 6875fa034563fdb251175b55caf57b4b8af02879..84080df4a8e14cff6a832957179139a099685cb8 100644 (file)
@@ -3,7 +3,7 @@ PROGRAM=test01
 SOURCE_FILES=$(PROGRAM).java
 
 BUILDSCRIPT=~/research/Robust/src/buildscript
-BSFLAGS= -recover -flatirtasks -ownership -enable-assertions
+BSFLAGS= -recover -ownership -ownaliasfile aliases.txt -ownwritedots final -enable-assertions
 
 all: $(PROGRAM).bin
 
@@ -24,6 +24,4 @@ clean:
        rm -f  *~
        rm -f  *.dot
        rm -f  *.png
-       rm -f  *.ps
-       rm -f  *.eps
-       rm -f  identifiedAliases.txt
+       rm -f  aliases.txt
index 1c0bd2c9202a078111177ff0ea238d00ab2970c4..cf4df16aeb65a86dd530c6ec2527fffb465f9c9d 100644 (file)
@@ -179,9 +179,9 @@ task Startup( StartupObject s{ initialstate } ) {
   //int a, b, c;
 
 
-  int a;
-  int b;
-  int c;
+  int a = 1;
+  int b = 2;
+  int c = 3;
 
   b = c;
   a = b;