debugged the reach graph support for effect conflicts
authorjjenista <jjenista>
Wed, 30 Jun 2010 18:51:43 +0000 (18:51 +0000)
committerjjenista <jjenista>
Wed, 30 Jun 2010 18:51:43 +0000 (18:51 +0000)
Robust/src/Analysis/Disjoint/ReachGraph.java
Robust/src/Analysis/OoOJava/ConflictGraph.java
Robust/src/Analysis/OoOJava/OoOJavaAnalysis.java
Robust/src/Makefile
Robust/src/Tests/disjoint/effectConflictSupportTest/makefile [new file with mode: 0644]
Robust/src/Tests/disjoint/effectConflictSupportTest/test.java [new file with mode: 0644]

index 5d44e8b4042c41897d30e7ab1c492e7ffe2210a5..10617e110624c2e45b791329b25215d7c594de4a 100644 (file)
@@ -4727,7 +4727,7 @@ public class ReachGraph {
         while( rtItr2.hasNext() ) {
           ReachTuple rt2 = rtItr2.next();
 
-          if( hrn.getAlpha().getStatesWithBoth( rt1, rt2 ) != null ) {
+          if( !hrn.getAlpha().getStatesWithBoth( rt1, rt2 ).isEmpty() ) {
             return true;
           }          
         }
@@ -4779,7 +4779,7 @@ public class ReachGraph {
             continue;
           }
 
-          if( hrn.getAlpha().getStatesWithBoth( rt1, rt2 ) != null ) {
+          if( !hrn.getAlpha().getStatesWithBoth( rt1, rt2 ).isEmpty() ) {
             return true;
           }          
         }
index 9a65b158f0dafd46e71f237b7153107e450fe1eb..f889a799a538176d15697a3416fa148762777de3 100644 (file)
@@ -368,19 +368,20 @@ public class ConflictGraph {
                 FlatNew fnRoot1 = asA.getFlatNew();
                 FlatNew fnRoot2 = asB.getFlatNew();
                 FlatNew fnTarget = effectA.getAffectedAllocSite().getFlatNew();
-                if (da.mayBothReachTarget(fmEnclosing, fnRoot1, fnRoot2, fnTarget)) {
-                  if (fnRoot1.equals(fnRoot2)) {
-                    if (!da.mayManyReachTarget(fmEnclosing, fnRoot1, fnTarget)) {
-                      // fine-grained conflict case
-                      conflictType =
-                          updateConflictType(conflictType, ConflictGraph.FINE_GRAIN_EDGE);
-                    } else {
-                      conflictType =
-                          updateConflictType(conflictType, ConflictGraph.COARSE_GRAIN_EDGE);
-                    }
+                if (fnRoot1.equals(fnRoot2)) {
+                  if (!da.mayManyReachTarget(fmEnclosing, fnRoot1, fnTarget)) {
+                    // fine-grained conflict case
+                    conflictType =
+                      updateConflictType(conflictType, ConflictGraph.FINE_GRAIN_EDGE);
                   } else {
                     conflictType =
-                        updateConflictType(conflictType, ConflictGraph.COARSE_GRAIN_EDGE);
+                      updateConflictType(conflictType, ConflictGraph.COARSE_GRAIN_EDGE);
+                  }
+                } else {
+                  if (da.mayBothReachTarget(fmEnclosing, fnRoot1, fnRoot2, fnTarget)) {
+                    conflictType =
+                      updateConflictType(conflictType, ConflictGraph.COARSE_GRAIN_EDGE);
+                  } else {
                   }
                 }
               } else {
index 217f8266a0fc2bd96e76553502ae0a0a2f259db7..e687d61a1e06a7b39edd3d6e384c9036100a0ccf 100644 (file)
@@ -225,7 +225,7 @@ public class OoOJavaAnalysis {
                            null, // don't do effects analysis again!
                            null  // don't do effects analysis again!
                            );
-writeConflictGraph();
+    //writeConflictGraph();
     // 10th pass, calculate conflicts with reachability info
     calculateConflicts(null, true);
     
index 15920cac6311ca349b3cd798363c6fbd156b4c8f..fda0ec2fb1086c375f62d39adea76af3fbc857fa 100644 (file)
@@ -194,7 +194,7 @@ clean:
        rm -f IR/*.class IR/Tree/*.class Main/*.class Lex/*.class Parse/*.class Parse/Sym.java Parse/Parser.java IR/Flat/*.class classdefs.h methodheaders.h methods.c structdefs.h virtualtable.h task.h taskdefs.c taskdefs.h Analysis/*.class Analysis/Flag/*.class Analysis/CallGraph/*.class  Analysis/TaskStateAnalysis/*.class Interface/*.class Util/*.class Analysis/Locality/*.class Analysis/Prefetch/*.class Analysis/FlatIRGraph/*.class Analysis/OwnershipAnalysis/*.class Analysis/Disjoint/*.class Analysis/OoOJava/*.class Analysis/MLP/*.class Analysis/Scheduling/*.class Analysis/Loops/*.class
 
 cleanclass:
-       rm -f IR/*.class IR/Tree/*.class Main/*.class IR/Flat/*.class Analysis/*.class Analysis/Flag/*.class Analysis/CallGraph/*.class  Analysis/TaskStateAnalysis/*.class Interface/*.class Util/*.class Analysis/Locality/*.class Analysis/Prefetch/*.class Analysis/FlatIRGraph/*.class Analysis/OwnershipAnalysis/*.class Analysis/Disjoint/*.class Analysis/MLP/*.class Analysis/Scheduling/*.class Analysis/Loops/*.class
+       rm -f IR/*.class IR/Tree/*.class Main/*.class IR/Flat/*.class Analysis/*.class Analysis/Flag/*.class Analysis/CallGraph/*.class  Analysis/TaskStateAnalysis/*.class Interface/*.class Util/*.class Analysis/Locality/*.class Analysis/Prefetch/*.class Analysis/FlatIRGraph/*.class Analysis/OwnershipAnalysis/*.class Analysis/Disjoint/*.class Analysis/OoOJava/*.class Analysis/MLP/*.class Analysis/Scheduling/*.class Analysis/Loops/*.class
 
 cleandoc:
        rm -rf javadoc
diff --git a/Robust/src/Tests/disjoint/effectConflictSupportTest/makefile b/Robust/src/Tests/disjoint/effectConflictSupportTest/makefile
new file mode 100644 (file)
index 0000000..ca5e7b0
--- /dev/null
@@ -0,0 +1,30 @@
+PROGRAM=test
+
+SOURCE_FILES=$(PROGRAM).java
+
+BUILDSCRIPT=~/research/Robust/src/buildscript
+
+BSFLAGS= -mainclass Test -joptimize -justanalyze -ooojava -disjoint -disjoint-k 1 -enable-assertions
+DEBUGFLAGS= -disjoint-write-dots final #-disjoint-write-initial-contexts -disjoint-write-ihms -disjoint-debug-snap-method main 0 10 true
+
+all: $(PROGRAM).bin
+
+view: PNGs
+       eog *.png &
+
+PNGs: DOTs
+       d2p *COMPLETE*.dot
+
+DOTs: $(PROGRAM).bin
+
+$(PROGRAM).bin: $(SOURCE_FILES)
+       $(BUILDSCRIPT) $(BSFLAGS) $(DEBUGFLAGS) -o $(PROGRAM) $(SOURCE_FILES)
+
+clean:
+       rm -f  $(PROGRAM).bin
+       rm -fr tmpbuilddirectory
+       rm -f  *~
+       rm -f  *.dot
+       rm -f  *.png
+       rm -f  aliases.txt
+       rm -f  effects.txt
diff --git a/Robust/src/Tests/disjoint/effectConflictSupportTest/test.java b/Robust/src/Tests/disjoint/effectConflictSupportTest/test.java
new file mode 100644 (file)
index 0000000..9857f23
--- /dev/null
@@ -0,0 +1,39 @@
+public class Foo {
+  public Foo() {}
+  public Foo f;
+  public Foo g;
+  public int v;
+}
+
+public class Test {
+
+  static public void main( String[] args ) {
+    
+    Foo r1 = new Foo();
+    Foo r2 = new Foo();
+
+    Foo a = null;
+
+    while( false ) {
+      
+      r2.f = r1.f;
+
+      if( true ) {
+        r1.f = a;
+      }
+
+      a = new Foo();
+    }
+
+    rblock r1 {
+      
+      rblock c1 {
+        r1.f.v = 1;
+      }
+
+      r2.f.v = 2;
+    }
+
+
+  }   
+}