taints at reach graph level implemented
authorjjenista <jjenista>
Tue, 22 Jun 2010 23:21:03 +0000 (23:21 +0000)
committerjjenista <jjenista>
Tue, 22 Jun 2010 23:21:03 +0000 (23:21 +0000)
Robust/src/Analysis/Disjoint/DisjointAnalysis.java
Robust/src/Analysis/Disjoint/ReachGraph.java
Robust/src/Analysis/Disjoint/Taint.java
Robust/src/IR/Flat/FlatSESEEnterNode.java
Robust/src/Tests/disjoint/taintTest1/test.java

index 567d9e3c8677011ee259458a19738d92654005b7..2e15b921981a16a9fdf7adad97221b21765297fb 100644 (file)
@@ -469,8 +469,9 @@ public class DisjointAnalysis {
   static protected Hashtable<FlatNode, ReachGraph> fn2rg =
     new Hashtable<FlatNode, ReachGraph>();
 
-  private Hashtable<FlatCall, Descriptor> fc2enclosing;
-  
+  private Hashtable<FlatCall, Descriptor> fc2enclosing;  
+
+  //protected RBlockRelationAnalysis rra;
 
 
   // allocate various structures that are not local
@@ -505,7 +506,7 @@ public class DisjointAnalysis {
 
     mapBackEdgeToMonotone =
       new Hashtable<FlatNode, ReachGraph>();
-
+    
     mapHrnIdToAllocSite =
       new Hashtable<Integer, AllocSite>();
 
@@ -553,6 +554,7 @@ public class DisjointAnalysis {
                           CallGraph        cg,
                           Liveness         l,
                           ArrayReferencees ar
+                           //RBlockRelationAnalysis rra
                            ) throws java.io.IOException {
     init( s, tu, cg, l, ar );
   }
@@ -562,6 +564,7 @@ public class DisjointAnalysis {
                        CallGraph        callGraph,
                        Liveness         liveness,
                        ArrayReferencees arrayReferencees
+                       //RBlockRelationAnalysis rra
                        ) throws java.io.IOException {
          
     analysisComplete = false;
@@ -1112,6 +1115,7 @@ public class DisjointAnalysis {
       }
       break;
 
+      /*
     case FKind.FlatSESEEnterNode:
       FlatSESEEnterNode sese = (FlatSESEEnterNode) fn;
       rg.taintLiveTemps( sese,
@@ -1123,7 +1127,8 @@ public class DisjointAnalysis {
       FlatSESEExitNode fsexn = (FlatSESEExitNode) fn;
       rg.removeInContextTaints( fsexn.getFlatEnter() );
       break;
-      
+      */
+
     case FKind.FlatCall: {
       Descriptor mdCaller;
       if( fmContaining.getMethod() != null ){
index 127ca15937edfeb7e136b748b9e24d41b7524e12..acd13a7561bd4edb57ede3178ba8134dc0d66770 100644 (file)
@@ -1243,38 +1243,32 @@ public class ReachGraph {
   }
 
 
-  public void taintLiveTemps( FlatSESEEnterNode sese, 
-                              Set<TempDescriptor> liveTemps
-                              ) {
-
-    System.out.println( "At "+sese+" with: "+liveTemps );
-
-    Iterator<TempDescriptor> tdItr = liveTemps.iterator();
-    while( tdItr.hasNext() ) {
-      TempDescriptor td = tdItr.next();
-      VariableNode   vn = td2vn.get( td );
-
-      Iterator<RefEdge> reItr = vn.iteratorToReferencees();
-      while( reItr.hasNext() ) {
-        RefEdge re = reItr.next();
-
-        // these new sese (rblock) taints should
-        // have empty predicates so they never propagate
-        // out to callers
-        Taint t = Taint.factory( sese,
-                                 td,
-                                 re.getDst().getAllocSite(),
-                                 ExistPredSet.factory()
-                                 );
-
-        re.setTaints( Canonical.add( re.getTaints(),
-                                     t 
-                                     )
-                      );
-      }
+  public void taintTemp( FlatSESEEnterNode sese, 
+                         TempDescriptor    td
+                         ) {
+    
+    VariableNode   vn = td2vn.get( td );
+    
+    Iterator<RefEdge> reItr = vn.iteratorToReferencees();
+    while( reItr.hasNext() ) {
+      RefEdge re = reItr.next();
+      
+      // these new sese (rblock) taints should
+      // have empty predicates so they never propagate
+      // out to callers
+      Taint t = Taint.factory( sese,
+                               td,
+                               re.getDst().getAllocSite(),
+                               ExistPredSet.factory()
+                               );
+      
+      re.setTaints( Canonical.add( re.getTaints(),
+                                   t 
+                                   )
+                    );
     }
   }
-
+  
   public void removeInContextTaints( FlatSESEEnterNode sese ) {
     
   }
index 440a33fabee50f4a29a33720007dd1b88e96da2b..24f0d9a4c6a918419dedc37ee4aa511436d839da 100644 (file)
@@ -129,8 +129,16 @@ public class Taint extends Canonical {
   }
 
   public String toString() {
+
+    String s;
+    if( sese.getIsCallerSESEplaceholder() ) {
+      s = "placeh";
+    } else {
+      s = sese.getPrettyIdentifier();
+    }
+
     return 
-      "("+sese.getPrettyIdentifier()+
+      "("+s+
       "-"+insetVar+
       ", "+allocSite.toStringBrief()+
       "):"+preds;
index e2e88057ed7e4599706fb1f84de088042678c22f..98569fddb2db953dc295876da745d594a59d54fd 100644 (file)
@@ -112,7 +112,7 @@ public class FlatSESEEnterNode extends FlatNode {
     return id;
   }
 
-  public String getPrettyIdentifier() {    
+  public String getPrettyIdentifier() {
     if( treeNode.getID() != null ) {
       return treeNode.getID();
     }     
index a8b37ef2f79035b0bbc5d145d067dccf34279f6b..ace7ac5e112f84fb3e67d1aeecc22d2be12b9d13 100644 (file)
@@ -9,25 +9,25 @@ public class Test {
   static public void main( String[] args ) {
 
     Foo a = new Foo();
+    doSomething( a );
+  }
 
-    rblock DU {
-      Foo b = new Foo();
-      Foo z = a.f;
-    }
+  static void doSomething( Foo a ) {
 
-    Foo c = new Foo();
-    Foo d = new Foo();
+    a.f = new Foo();
     
-    //doSomething( a, b, c );
-  }
-
-  static void doSomething( Foo a, Foo b, Foo c ) {
+    rblock r1 {
+      Foo b = a.f;
+      b.f = new Foo();
+    }
 
-    rblock YO {
-      Foo e = doStuff( a, b );
+    rblock r2 {
+      Foo c = a.f.f;
+      c.f = new Foo();
     }
 
-    Foo f = doStuff( a, c );
+
+    //Foo f = doStuff( a, c );
   }   
 
   static Foo doStuff( Foo m, Foo n ) {