got the hooks in place to get taints for rblocks
authorjjenista <jjenista>
Tue, 22 Jun 2010 21:40:01 +0000 (21:40 +0000)
committerjjenista <jjenista>
Tue, 22 Jun 2010 21:40:01 +0000 (21:40 +0000)
Robust/src/Analysis/Disjoint/DisjointAnalysis.java
Robust/src/Analysis/Disjoint/PointerMethod.java
Robust/src/Analysis/Disjoint/ReachGraph.java
Robust/src/Analysis/Disjoint/Taint.java
Robust/src/IR/Flat/BuildFlat.java
Robust/src/Tests/disjoint/taintTest1/makefile
Robust/src/Tests/disjoint/taintTest1/test.java

index f40261fa6a2bc632fe27e349ad92f1e77d52aa13..567d9e3c8677011ee259458a19738d92654005b7 100644 (file)
@@ -1112,6 +1112,18 @@ public class DisjointAnalysis {
       }
       break;
 
+    case FKind.FlatSESEEnterNode:
+      FlatSESEEnterNode sese = (FlatSESEEnterNode) fn;
+      rg.taintLiveTemps( sese,
+                         liveness.getLiveInTemps( fmContaining, fn ) 
+                         );
+      break;
+
+    case FKind.FlatSESEExitNode:
+      FlatSESEExitNode fsexn = (FlatSESEExitNode) fn;
+      rg.removeInContextTaints( fsexn.getFlatEnter() );
+      break;
+      
     case FKind.FlatCall: {
       Descriptor mdCaller;
       if( fmContaining.getMethod() != null ){
index 372a0fcac1a829ec8db9b2a1ff283c5684cef092..396474d3c2f9199bcf0179891171ef202eafba6d 100644 (file)
@@ -95,6 +95,8 @@ public class PointerMethod {
     case FKind.FlatCall:
     case FKind.FlatReturnNode:
     case FKind.FlatBackEdge:
+    case FKind.FlatSESEEnterNode:
+    case FKind.FlatSESEExitNode:
       return true;
     case FKind.FlatCastNode:
       FlatCastNode fcn=(FlatCastNode)fn;
index 2b5548945987da415195cec87c5a870113b664a4..127ca15937edfeb7e136b748b9e24d41b7524e12 100644 (file)
@@ -1243,6 +1243,43 @@ 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 removeInContextTaints( FlatSESEEnterNode sese ) {
+    
+  }
+
+
   // used in makeCalleeView below to decide if there is
   // already an appropriate out-of-context edge in a callee
   // view graph for merging, or null if a new one will be added
index 06ac9a9d5661def7d6e0869d3a83c1bad1bfdd4c..440a33fabee50f4a29a33720007dd1b88e96da2b 100644 (file)
@@ -130,7 +130,7 @@ public class Taint extends Canonical {
 
   public String toString() {
     return 
-      "("+sese.toPrettyString()+
+      "("+sese.getPrettyIdentifier()+
       "-"+insetVar+
       ", "+allocSite.toStringBrief()+
       "):"+preds;
index a895190ad9c89d1e327b5fff3741caa1e85f3e5d..584e876785a79cc44f8e106b6e03c21c8a41f848 100644 (file)
@@ -163,7 +163,7 @@ public class BuildFlat {
       // that method at runtime
       FlatSESEEnterNode spliceSESE = null;
       FlatSESEExitNode  spliceExit = null;
-      if( state.MLP ) {
+      if( state.MLP || state.OOOJAVA ) {
        if( currmd.equals( typeutil.getMain() ) ) {
          SESENode mainTree = new SESENode( "main" );
          spliceSESE = new FlatSESEEnterNode( mainTree );
@@ -216,7 +216,7 @@ public class BuildFlat {
       } else if (np.getEnd()!=null&&np.getEnd().kind()!=FKind.FlatReturnNode) {
        FlatNode rnflat=null;
        // splice implicit SESE exit after method body
-       if( state.MLP ) {
+       if( state.MLP || state.OOOJAVA ) {
          np.getEnd().addNext(spliceExit);
          rnflat=spliceReturn(spliceExit);
        } else {
@@ -225,7 +225,7 @@ public class BuildFlat {
        rnflat.addNext(fe);
       } else if (np.getEnd()!=null) {
        // splice implicit SESE exit after method body
-       if( state.MLP ) {
+       if( state.MLP || state.OOOJAVA ) {
          FlatReturnNode rnflat=(FlatReturnNode)np.getEnd();
          np.getEnd().addNext(spliceExit);
          spliceExit.addNext(fe);
@@ -233,7 +233,7 @@ public class BuildFlat {
       }
 
       // splice an implicit SESE enter before method body
-      if( state.MLP ) {
+      if( state.MLP || state.OOOJAVA ) {
        spliceSESE.addNext(fn);
        fn=spliceSESE;   
       }
index af136378f6f68bd8f27f04bf8bcbadc776c39799..2224b4054e39b1be53430c272a859d98619039a7 100644 (file)
@@ -5,7 +5,7 @@ SOURCE_FILES=$(PROGRAM).java
 BUILDSCRIPT=~/research/Robust/src/buildscript
 
 
-BSFLAGS= -mainclass Test -justanalyze -disjoint -disjoint-k 2 -disjoint-write-dots final -enable-assertions
+BSFLAGS= -mainclass Test -justanalyze -ooojava -disjoint -disjoint-k 2 -disjoint-write-dots final -enable-assertions
 
 all: $(PROGRAM).bin
 
index bae5a1a5ab72122d103e362b8345bf9e700dd5ec..a8b37ef2f79035b0bbc5d145d067dccf34279f6b 100644 (file)
@@ -9,14 +9,24 @@ public class Test {
   static public void main( String[] args ) {
 
     Foo a = new Foo();
-    Foo b = new Foo();
+
+    rblock DU {
+      Foo b = new Foo();
+      Foo z = a.f;
+    }
+
     Foo c = new Foo();
     Foo d = new Foo();
-    giveParamNames( a, b, c );
+    
+    //doSomething( a, b, c );
   }
 
-  static void giveParamNames( Foo a, Foo b, Foo c ) {
-    Foo e = doStuff( a, b );
+  static void doSomething( Foo a, Foo b, Foo c ) {
+
+    rblock YO {
+      Foo e = doStuff( a, b );
+    }
+
     Foo f = doStuff( a, c );
   }