new analysis for array references that create no new reachability is in, and correctl...
authorjjenista <jjenista>
Fri, 30 Oct 2009 20:30:18 +0000 (20:30 +0000)
committerjjenista <jjenista>
Fri, 30 Oct 2009 20:30:18 +0000 (20:30 +0000)
Robust/src/Analysis/ArrayReferencees.java
Robust/src/Analysis/MLP/MLPAnalysis.java
Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java
Robust/src/Benchmarks/mlp/directto/mlp-small-for-testing/FlightList.java
Robust/src/Benchmarks/mlp/directto/mlp-small-for-testing/MessageList.java
Robust/src/Benchmarks/mlp/directto/mlp-small-for-testing/makefile
Robust/src/Main/Main.java

index 5e351538ad1d71f37de851fddf09fa9e5691c085..0aa28df6e35d8a110424395d0a112a0b2c5ac301 100644 (file)
 package Analysis;
 
 import IR.State;
-import IR.Flat.FlatMethod;
-import IR.Flat.FlatNode;
-import IR.Flat.FlatCall;
-import IR.Flat.FKind;
 import IR.Descriptor;
 import IR.ClassDescriptor;
 import IR.MethodDescriptor;
 import IR.TaskDescriptor;
 import IR.TypeDescriptor;
+import IR.Flat.TempDescriptor;
+import IR.Flat.FlatMethod;
+import IR.Flat.FlatNode;
+import IR.Flat.FlatElementNode;
+import IR.Flat.FlatSetElementNode;
+import IR.Flat.FKind;
 import Util.UtilAlgorithms;
 import java.util.*;
 import java.io.*;
@@ -37,8 +39,8 @@ public class ArrayReferencees {
     init( state );
   }
 
-  public boolean mayCreateNewReachabilityPaths( FlatSetElementNode fsen ) {
-    return true;
+  public boolean doesNotCreateNewReaching( FlatSetElementNode fsen ) {
+    return noNewReaching.contains( fsen );
   }
   ////////////////////////////////
   // end public interface
@@ -51,12 +53,17 @@ public class ArrayReferencees {
   // maintain the relation at every program point
   protected Hashtable<FlatNode, InArrayRelation> fn2rel;
 
+  // use relation to calculate set of array populate
+  // nodes that cannot create new reachability paths
+  protected Set<FlatSetElementNode> noNewReaching;
+
 
   protected ArrayReferencees() {}
 
   protected void init( State state ) {
     this.state = state;
     fn2rel = new Hashtable<FlatNode, InArrayRelation>();
+    noNewReaching = new HashSet<FlatSetElementNode>();
     buildRelation();
   }
 
@@ -99,7 +106,7 @@ public class ArrayReferencees {
         }
       }
 
-      analyzeFlatNode( rel, fn );
+      analyzeFlatNode( fn, rel );
 
       // enqueue child nodes if new results were found
       InArrayRelation relPrev = fn2rel.get( fn );
@@ -136,6 +143,20 @@ public class ArrayReferencees {
       FlatSetElementNode fsen = (FlatSetElementNode) fn;
       lhs = fsen.getDst();
       rhs = fsen.getSrc();
+
+      // use relation result coming into this program
+      // point ("rel" before we modify it) to compute
+      // whether this node affects reachability paths
+      if( rel.canArrayAlreadyReach( lhs, rhs ) ) {
+        noNewReaching.add( fsen );
+
+      } else {
+        // otherwise we can't be sure, so remove
+        noNewReaching.remove( fsen );
+      }
+
+      // then update the relation for the fixed-point
+      // analysis to continue
       rel.put_array2refee( lhs, rhs );
       break;    
       
@@ -151,120 +172,231 @@ public class ArrayReferencees {
 
     }
   }
-}
 
 
 
-protected class InArrayRelation {
 
-  // The relation is possibly dense, in that any variable might
-  // be referenced by many arrays, and an array may reference
-  // many variables.  So maintain the relation as two hashtables
-  // that are redundant but allow efficient operations
-  protected Hashtable< TempDescriptor, Set<TempDescriptor> > array2refees;
-  protected Hashtable< TempDescriptor, Set<TempDescriptor> > refee2arrays;
-  
-  public InArrayRelation() {
-    array2refees = new Hashtable< TempDescriptor, Set<TempDescriptor> >();
-    refee2arrays = new Hashtable< TempDescriptor, Set<TempDescriptor> >();
-  }
+  protected class InArrayRelation {
 
-  public void put_array2refee( TempDescriptor array, TempDescriptor refee ) {
-    // update one direction
-    Set<TempDescriptor> refees = array2refees.get( array );
-    if( refees == null ) {
-      refees = new HashSet<TempDescriptor>();
+    // The relation is possibly dense, in that any variable might
+    // be referenced by many arrays, and an array may reference
+    // many variables.  So maintain the relation as two hashtables
+    // that are redundant but allow efficient operations
+    protected Hashtable< TempDescriptor, Set<TempDescriptor> > array2refees;
+    protected Hashtable< TempDescriptor, Set<TempDescriptor> > refee2arrays;
+    
+    public InArrayRelation() {
+      array2refees = new Hashtable< TempDescriptor, Set<TempDescriptor> >();
+      refee2arrays = new Hashtable< TempDescriptor, Set<TempDescriptor> >();
     }
-    refees.add( refee );
-    array2refees.put( array, refees );
 
-    // and then the other
-    Set<TempDescriptor> arrays = refee2arrays.get( refee );
-    if( arrayss == null ) {
-      arrays = new HashSet<TempDescriptor>();
+    public boolean canArrayAlreadyReach( TempDescriptor array, 
+                                         TempDescriptor elem ) {
+      
+      Set<TempDescriptor> refees = array2refees.get( array );
+      return refees != null && refees.contains( elem );
     }
-    arrays.add( array );
-    refee2arrays.put( refee, arrays );
+    
+    public void put_array2refee( TempDescriptor array, TempDescriptor refee ) {
+      // update one direction
+      Set<TempDescriptor> refees = array2refees.get( array );
+      if( refees == null ) {
+        refees = new HashSet<TempDescriptor>();
+      }
+      refees.add( refee );
+      array2refees.put( array, refees );
+    
+      // and then the other
+      Set<TempDescriptor> arrays = refee2arrays.get( refee );
+      if( arrays == null ) {
+        arrays = new HashSet<TempDescriptor>();
+      }
+      arrays.add( array );
+      refee2arrays.put( refee, arrays );
 
-    assertConsistent();
-  }
+      assertConsistent();
+    }
+
+    public void remove( TempDescriptor td ) {
+      // removal of one temp from the relation is a bit
+      // tricky--it can be on either side of the pair or
+      // both at the same time
+
+      // during traversal, mark keys that should be removed
+      Set<TempDescriptor> a2rKeysToRemove = new HashSet<TempDescriptor>();
+      Set<TempDescriptor> r2aKeysToRemove = new HashSet<TempDescriptor>();
+
+      // also during traversal, mark sets by how they 
+      // should be shortened
+      Hashtable<Set, Set> set2removals = new Hashtable<Set, Set>();
 
-  public void remove( TempDescriptor td ) {
+      {
+        // first consider one side of the relation
+        Set<TempDescriptor> refees = array2refees.get( td );
+        if( refees != null ) {
+          assert !refees.isEmpty();
+      
+          // definitely remove the key from this mapping
+          a2rKeysToRemove.add( td );
+      
+          // and remove it from set values in the other mapping
+          Iterator<TempDescriptor> refItr = refees.iterator();
+          while( refItr.hasNext() ) {
+            TempDescriptor ref = refItr.next();
+            
+            Set<TempDescriptor> arrays = refee2arrays.get( ref );
+            assert arrays != null;
+            assert !arrays.isEmpty();
+            
+            Set<TempDescriptor> removals = set2removals.get( arrays );
+            if( removals == null ) {
+              removals = new HashSet<TempDescriptor>();
+            }
+            removals.add( td );
+            set2removals.put( arrays, removals );
+            
+            if( removals.size() == arrays.size() ) {
+              // we've marked everything in this for removal! So
+              // just remove the key from the mapping
+              assert arrays.containsAll( removals );
+              r2aKeysToRemove.add( ref );
+            }
+          }
+        }
+      }
+
+      {
+        // and then see if it is in the relation's other direction
+        Set<TempDescriptor> arrays = refee2arrays.get( td );
+        if( arrays != null ) {
+          assert !arrays.isEmpty();
+          
+          // definitely remove the key from this mapping
+          r2aKeysToRemove.add( td );
+          
+          // and remove it from set values in the other mapping
+          Iterator<TempDescriptor> arrItr = arrays.iterator();
+          while( arrItr.hasNext() ) {
+            TempDescriptor arr = arrItr.next();
+            
+            Set<TempDescriptor> refees = array2refees.get( arr );
+            assert refees != null;
+            assert !refees.isEmpty();
+
+            Set<TempDescriptor> removals = set2removals.get( refees );
+            if( removals == null ) {
+              removals = new HashSet<TempDescriptor>();
+            }
+            removals.add( td );
+            set2removals.put( refees, removals );
+
+            if( removals.size() == refees.size() ) {
+              // we've marked everything in this for removal! So
+              // just remove the key from the mapping
+              assert refees.containsAll( removals );
+              a2rKeysToRemove.add( arr );
+            }
+          }
+        }
+      }
     
+      // perform all marked removing now
+      Iterator<TempDescriptor> keyItr;
+      
+      keyItr = a2rKeysToRemove.iterator();
+      while( keyItr.hasNext() ) {
+        array2refees.remove( keyItr.next() );
+      }
+
+      keyItr = r2aKeysToRemove.iterator();
+      while( keyItr.hasNext() ) {
+        refee2arrays.remove( keyItr.next() );
+      }
+
+      Iterator meItr = set2removals.entrySet().iterator();
+      while( meItr.hasNext() ) {
+        Map.Entry me       = (Map.Entry) meItr.next();
+        Set       set      = (Set)       me.getKey();
+        Set       removals = (Set)       me.getValue();
+
+        set.removeAll( removals );
+      }
 
-    assertConsistent();
-  }
-  
-  public void merge( InArrayRelation r ) {
-    if( r == null ) {
-      return;
-    }
-    UtilAlgorithms.mergeHashtablesWithHashSetValues( array2refees, r.array2refees );
-    UtilAlgorithms.mergeHashtablesWithHashSetValues( refee2arrays, r.refee2arrays );
-    assertConsistent();
-  }
 
-  public void intersect( InArrayRelation r ) {
-    if( r == null ) {
-      array2refees.clear();
-      refee2arrays.clear();
-      return;
+      assertConsistent();
     }
-    UtilAlgorithms.intersectHashtablesWithSetValues( array2refees, r.array2refees );
-    UtilAlgorithms.intersectHashtablesWithSetValues( refee2arrays, r.refee2arrays );
-    assertConsistent();
-  }
-  
-  public void assertConsistent() {
-    assert allEntriesInAReversedInB( array2refees, refee2arrays );
-    assert allEntriesInAReversedInB( refee2arrays, array2refees );
-  }
   
-  protected boolean allEntriesInAReversedInB( 
-    Hashtable< TempDescriptor, Set<TempDescriptor> > a,
-    Hashtable< TempDescriptor, Set<TempDescriptor> > b ) {
+    public void merge( InArrayRelation r ) {
+      if( r == null ) {
+        return;
+      }
+      UtilAlgorithms.mergeHashtablesWithHashSetValues( array2refees, r.array2refees );
+      UtilAlgorithms.mergeHashtablesWithHashSetValues( refee2arrays, r.refee2arrays );
+      assertConsistent();
+    }
+    
+    public void intersect( InArrayRelation r ) {
+      if( r == null ) {
+        array2refees.clear();
+        refee2arrays.clear();
+        return;
+      }
+      UtilAlgorithms.intersectHashtablesWithSetValues( array2refees, r.array2refees );
+      UtilAlgorithms.intersectHashtablesWithSetValues( refee2arrays, r.refee2arrays );
+      assertConsistent();
+    }
+    
+    public void assertConsistent() {
+      assert allEntriesInAReversedInB( array2refees, refee2arrays );
+      assert allEntriesInAReversedInB( refee2arrays, array2refees );
+    }
     
-    Iterator mapItr = a.entrySet().iterator();
-    while( mapItr.hasNext() ) {
-      Map.Entry           me    = (Map.Entry)           mapItr.next();
-      TempDescriptor      keyA  = (TempDescriptor)      me.getKey();
-      Set<TempDescriptor> valsA = (Set<TempDescriptor>) me.getValue();
+    protected boolean allEntriesInAReversedInB( 
+      Hashtable< TempDescriptor, Set<TempDescriptor> > a,
+      Hashtable< TempDescriptor, Set<TempDescriptor> > b ) {
       
-      Iterator<TempDescriptor> valItr = valsA.iterator();
-      while( valItr.hasNext() ) {
-        TempDescriptor valA = valItr.next();
+      Iterator mapItr = a.entrySet().iterator();
+      while( mapItr.hasNext() ) {
+        Map.Entry           me    = (Map.Entry)           mapItr.next();
+        TempDescriptor      keyA  = (TempDescriptor)      me.getKey();
+        Set<TempDescriptor> valsA = (Set<TempDescriptor>) me.getValue();
         
-        Set<TempDescriptor> valsB = b.get( valA );
+        Iterator<TempDescriptor> valItr = valsA.iterator();
+        while( valItr.hasNext() ) {
+          TempDescriptor valA = valItr.next();
         
-        if( valsB == null ) {
-          return false;
-        }
-        
-        if( !valsB.contains( keyA ) ) {
-          return false;
+          Set<TempDescriptor> valsB = b.get( valA );
+          
+          if( valsB == null ) {
+            return false;
+          }
+          
+          if( !valsB.contains( keyA ) ) {
+            return false;
+          }
         }
       }
-    }
     
-    return true;
-  }
-
-  public boolean equals( Object o ) {
-    if( o == null ) {
-      return false;
+      return true;
     }
-    if( !(o instanceof InArrayRelation) ) {
-      return false;
+
+    public boolean equals( Object o ) {
+      if( o == null ) {
+        return false;
+      }
+      if( !(o instanceof InArrayRelation) ) {
+        return false;
+      }
+      InArrayRelation rel = (InArrayRelation) o;
+      return 
+        array2refees.equals( rel.array2refees ) &&
+        refee2arrays.equals( rel.refee2arrays );
     }
-    InArrayRelation rel = (InArrayRelation) o;
-    return 
-      array2refees.equals( rel.array2refees ) &&
-      refee2arrays.equals( rel.refee2arrays );
-  }
 
-  public int hashCode() {
-    return 
-      array2refees.hashCode() +
-      refee2arrays.hashCode();
-  }
+    public int hashCode() {
+      return 
+        array2refees.hashCode() +
+        refee2arrays.hashCode();
+    }
+  }  
 }
index 64cea77078af1a1e96aed753fc245ac4ce1e16e7..c031a12a221b1a250771380a9f881cce6dc53f54 100644 (file)
@@ -213,11 +213,15 @@ public class MLPAnalysis {
     
     // disjoint analysis with a set of flagged allocation sites of live-in variable
        try {
-         OwnershipAnalysis oa2 = new OwnershipAnalysis(state, tu, callGraph, new Liveness(),
-                               state.OWNERSHIPALLOCDEPTH, false,
-                               false, state.OWNERSHIPALIASFILE,
-                               state.METHODEFFECTS,
-                               mapMethodContextToLiveInAllocationSiteSet);
+         OwnershipAnalysis oa2 = new OwnershipAnalysis(state, 
+                                                        tu, 
+                                                        callGraph, 
+                                                        ownAnalysis.liveness,
+                                                        ownAnalysis.arrayReferencees,
+                                                        state.OWNERSHIPALLOCDEPTH, false,
+                                                        false, state.OWNERSHIPALIASFILE,
+                                                        state.METHODEFFECTS,
+                                                        mapMethodContextToLiveInAllocationSiteSet);
                // debug
                methItr = oa2.descriptorsToAnalyze.iterator();
                while (methItr.hasNext()) {
index 19862e123b34e7f91345ee95e2f436977c5e4a24..17f9c02d5a0a70643a78ad3af8c3e2a1bba5a444 100644 (file)
@@ -2,6 +2,7 @@ package Analysis.OwnershipAnalysis;
 
 import Analysis.CallGraph.*;
 import Analysis.Liveness;
+import Analysis.ArrayReferencees;
 import IR.*;
 import IR.Flat.*;
 import IR.Tree.Modifiers;
@@ -314,11 +315,12 @@ public class OwnershipAnalysis {
 
 
   // data from the compiler
-  public State     state;
-  public CallGraph callGraph;
-  public Liveness  liveness;
-  public TypeUtil  typeUtil;
-  public int       allocationDepth;
+  public State            state;
+  public CallGraph        callGraph;
+  public Liveness         liveness;
+  public ArrayReferencees arrayReferencees;
+  public TypeUtil         typeUtil;
+  public int              allocationDepth;
 
   // for public interface methods to warn that they
   // are grabbing results during analysis
@@ -396,13 +398,14 @@ public class OwnershipAnalysis {
                            TypeUtil tu,
                            CallGraph callGraph,
                           Liveness liveness,
+                           ArrayReferencees ar,
                            int allocationDepth,
                            boolean writeDOTs,
                            boolean writeAllDOTs,
                            String aliasFile) throws java.io.IOException {
          
          this.methodEffects = false;
-         init(state,tu,callGraph,liveness,allocationDepth,writeDOTs,writeAllDOTs,aliasFile);
+         init(state,tu,callGraph,liveness,ar,allocationDepth,writeDOTs,writeAllDOTs,aliasFile);
          
   }
   
@@ -410,6 +413,7 @@ public class OwnershipAnalysis {
                           TypeUtil tu,
                           CallGraph callGraph,
                           Liveness liveness,
+                           ArrayReferencees ar,
                           int allocationDepth,
                           boolean writeDOTs,
                           boolean writeAllDOTs,
@@ -417,7 +421,7 @@ public class OwnershipAnalysis {
                           boolean methodEffects) throws java.io.IOException {
          
          this.methodEffects = methodEffects;
-         init(state,tu,callGraph,liveness,allocationDepth,writeDOTs,writeAllDOTs,aliasFile);
+         init(state,tu,callGraph,liveness,ar,allocationDepth,writeDOTs,writeAllDOTs,aliasFile);
          
   }
   
@@ -427,6 +431,7 @@ public class OwnershipAnalysis {
                        TypeUtil tu,
                        CallGraph callGraph,
                        Liveness liveness,
+                        ArrayReferencees ar,
                        int allocationDepth,
                        boolean writeDOTs,
                        boolean writeAllDOTs,
@@ -437,7 +442,7 @@ public class OwnershipAnalysis {
 
                this.methodEffects = methodEffects;
                this.mapMethodContextToLiveInAllocationSiteSet=mapMethodContextToLiveInAllocationSiteSet;
-               init(state, tu, callGraph, liveness, allocationDepth, writeDOTs, writeAllDOTs,
+               init(state, tu, callGraph, liveness, ar, allocationDepth, writeDOTs, writeAllDOTs,
                                aliasFile);
 
        }
@@ -446,6 +451,7 @@ public class OwnershipAnalysis {
                    TypeUtil tu,
                    CallGraph callGraph,
                    Liveness liveness,
+                    ArrayReferencees ar,
                    int allocationDepth,
                    boolean writeDOTs,
                    boolean writeAllDOTs,
@@ -453,13 +459,14 @@ public class OwnershipAnalysis {
 
            analysisComplete = false;
 
-           this.state           = state;
-           this.typeUtil        = tu;
-           this.callGraph       = callGraph;
-           this.liveness        = liveness;
-           this.allocationDepth = allocationDepth;
-           this.writeDOTs       = writeDOTs;
-           this.writeAllDOTs    = writeAllDOTs;
+           this.state            = state;
+           this.typeUtil         = tu;
+           this.callGraph        = callGraph;
+           this.liveness         = liveness;
+            this.arrayReferencees = ar;
+           this.allocationDepth  = allocationDepth;
+           this.writeDOTs        = writeDOTs;
+           this.writeAllDOTs     = writeAllDOTs;
 
            // set some static configuration for OwnershipGraphs
            OwnershipGraph.allocationDepth   = allocationDepth;
@@ -946,6 +953,11 @@ public class OwnershipAnalysis {
 
     case FKind.FlatSetElementNode:
       FlatSetElementNode fsen = (FlatSetElementNode) fn;
+
+      if( arrayReferencees.doesNotCreateNewReaching( fsen ) ) {
+        System.out.println( "Skipping no-heap-effect: "+fsen );
+      }
+
       lhs = fsen.getDst();
       rhs = fsen.getSrc();
       if( !rhs.getType().isImmutable() || rhs.getType().isArray() ) {
index 1d9a500aa2b1334e598c950365a5f9d330a6bb07..746516ec3a872f9be7a80cd561e1becb46b0a9cb 100644 (file)
@@ -37,8 +37,16 @@ public class FlightList {
   public  void amendFlightPlan(D2 d2, int time, StringTokenizer st) {
     Flight fAux=getFlight(st.nextToken());
     Route rAux=new Route(Integer.parseInt(st.nextToken()));    
-    for (int i=0;i<rAux.noFixes;i++)
-      rAux.addFix(d2,i,st.nextToken());      
+
+
+    //////////////////////////////
+    // do this once    
+    //for (int i=0;i<rAux.noFixes;i++)
+    //  rAux.addFix(d2,i,st.nextToken());      
+    //////////////////////////////
+    rAux.addFix(d2,0,st.nextToken());      
+
+
     fAux.fPlan.setRoute(rAux);
     fAux.fPlan.setCruiseParam(Double.parseDouble(st.nextToken()), Double.parseDouble(st.nextToken()));
   }
index 2f268cb414a4ff7dc2008aa3e53f0f4c39a511f2..7dac0dd2fbbf7f2328f83c0ebcf8a0a459dfabea 100644 (file)
@@ -47,8 +47,18 @@ public class MessageList {
   
   public void executeAll(D2 d2) {
     System.out.println("executeAll: we have "+messages.size()+" messages.");
-    while(hasNext())
-      next().executeMessage(d2);     
+
+
+
+    ///////////////////////////////////
+    // alternate version of this not
+    // in a loop...
+    //while(hasNext())
+    //  next().executeMessage(d2);     
+    ///////////////////////////////////    
+    next().executeMessage(d2);     
+
+
 
     d2.getStatic().printInfo();
     d2.getFixList().printInfo();
index 5a62e8d33fbf0099aded9ccdae4c234e30522fd9..158577edfe83c6ebb7869e684750dc8b13347e84 100644 (file)
@@ -4,11 +4,20 @@ PROGRAM=test
 SOURCE_FILES=D2.java
 
 BUILDSCRIPT=~/research/Robust/src/buildscript
-BSFLAGS= -debug -nooptimize -mainclass $(MAIN_CLASS) 
+BSFLAGS= -debug -mainclass $(MAIN_CLASS) -flatirusermethods -flatirlibmethods -joptimize #-nooptimize
 
-DBCALLFLAGS= -owndebugcaller main -owndebugcallee executeAll 
+#DBCALLFLAGS= -owndebugcaller main -owndebugcallee executeAll 
 #DBCALLFLAGS= -owndebugcaller executeAll -owndebugcallee executeMessage -owndebugcallcount 0
-#DBCALLFLAGS= -owndebugcaller executeMessage -owndebugcallee amendFlightPlan
+#DBCALLFLAGS= -owndebugcaller executeAll -owndebugcallee next -owndebugcallcount 0
+#DBCALLFLAGS= -owndebugcaller executeAll -owndebugcallee hasNext -owndebugcallcount 0
+#DBCALLFLAGS= -owndebugcaller executeAll -owndebugcallee size -owndebugcallcount 0
+#DBCALLFLAGS= -owndebugcaller executeMessage -owndebugcallee getFlightList -owndebugcallcount 0
+#DBCALLFLAGS= -owndebugcaller executeMessage -owndebugcallee amendFlightPlan -owndebugcallcount 0
+#DBCALLFLAGS= -owndebugcaller amendFlightPlan -owndebugcallee getFlight -owndebugcallcount 0
+#DBCALLFLAGS= -owndebugcaller amendFlightPlan -owndebugcallee addFix -owndebugcallcount 0
+#DBCALLFLAGS= -owndebugcaller addFix -owndebugcallee addFix -owndebugcallcount 0
+DBCALLFLAGS= -owndebugcaller addFix -owndebugcallee insertElementAt -owndebugcallcount 0
+#DBCALLFLAGS= -owndebugcaller insertElementAt -owndebugcallee ensureCapacity -owndebugcallcount 0
 
 ANALYZEFLAGS= -justanalyze $(DBCALLFLAGS) -ownership -ownallocdepth 1 -ownwritedots final -ownaliasfile aliases.txt -enable-assertions
 
index 776542382c48d8f87f36e6b8aefff2f7f5126aa0..8b6c5a67ae0279b3a092c65425fcc0868d11f601 100644 (file)
@@ -44,6 +44,7 @@ import Analysis.OwnershipAnalysis.OwnershipAnalysis;
 import Analysis.MLP.MLPAnalysis;
 import Analysis.Loops.*;
 import Analysis.Liveness;
+import Analysis.ArrayReferencees;
 import IR.MethodDescriptor;
 import IR.Flat.FlatMethod;
 import Interface.*;
@@ -351,10 +352,12 @@ public class Main {
     if (state.OWNERSHIP && !state.MLP) {
       CallGraph callGraph = new CallGraph(state);
       Liveness liveness = new Liveness();
+      ArrayReferencees ar = new ArrayReferencees(state);
       OwnershipAnalysis oa = new OwnershipAnalysis(state,
                                                    tu,
                                                    callGraph,
                                                   liveness,
+                                                   ar,
                                                    state.OWNERSHIPALLOCDEPTH,
                                                    state.OWNERSHIPWRITEDOTS,
                                                    state.OWNERSHIPWRITEALL,
@@ -365,10 +368,12 @@ public class Main {
     if (state.MLP) {
       CallGraph callGraph = new CallGraph(state);
       Liveness liveness = new Liveness();
+      ArrayReferencees ar = new ArrayReferencees(state);
       OwnershipAnalysis oa = new OwnershipAnalysis(state,
                                                    tu,
                                                    callGraph,
                                                   liveness,
+                                                   ar,
                                                   state.OWNERSHIPALLOCDEPTH,
                                                    state.OWNERSHIPWRITEDOTS,
                                                    state.OWNERSHIPWRITEALL,
@@ -414,10 +419,12 @@ public class Main {
        // Use ownership analysis to get alias information
        CallGraph callGraph = new CallGraph(state);
        Liveness liveness = new Liveness();
+        ArrayReferencees ar = new ArrayReferencees(state);
        OwnershipAnalysis oa = new OwnershipAnalysis(state,
                                                     tu,
                                                     callGraph,
                                                     liveness,
+                                                     ar,
                                                     state.OWNERSHIPALLOCDEPTH,
                                                     state.OWNERSHIPWRITEDOTS,
                                                     state.OWNERSHIPWRITEALL,