fix for x = y.f statements copying by type and ignoring field name
authorjjenista <jjenista>
Mon, 14 Sep 2009 22:25:47 +0000 (22:25 +0000)
committerjjenista <jjenista>
Mon, 14 Sep 2009 22:25:47 +0000 (22:25 +0000)
Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java
Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java

index df464d43438083aa2b4038dd54529f6d9e66cb04..276890f2d6027c590b1d2401929d41f1315e69ca 100644 (file)
@@ -244,6 +244,47 @@ public class OwnershipAnalysis {
     bw.write( "\n"+computeAliasContextHistogram() );
     bw.close();
   }
+
+
+
+
+  /*
+  getFlaggedAllocationSitesReachableFromTask(TaskDescriptor td) {
+    return getFlaggedAllocationSitesReachableFromTaskPRIVATE(td);
+  }
+
+  public AllocationSite getAllocationSiteFromFlatNew(FlatNew fn) {
+    return getAllocationSiteFromFlatNewPRIVATE(fn);
+  }
+  */
+
+  // return the set of allocation sites for the object that the
+  // given variable may reference at the given program point
+  public Set<AllocationSite> possible( TempDescriptor temp,
+                                      FlatNode       ppoint ) {
+    assert temp   != null;
+    assert ppoint != null;
+
+    /*
+    OwnershipGraph og = new OwnershipGraph( allocationDepth, typeUtil );
+
+    assert mapDescriptorToAllMethodContexts.containsKey( d );
+    HashSet<MethodContext> contexts = mapDescriptorToAllMethodContexts.get( d );
+    Iterator<MethodContext> mcItr = contexts.iterator();
+    while( mcItr.hasNext() ) {
+      MethodContext mc = mcItr.next();
+
+      OwnershipGraph ogContext = mapMethodContextToCompleteOwnershipGraph.get(mc);
+      assert ogContext != null;
+
+      og.merge( ogContext );
+    }
+
+    return og;
+    */
+
+    return null;
+  }  
   ///////////////////////////////////////////
   //
   // end public interface
index 58c38d0efe776181c3bf3d2f72d5d783e7ad509c..ed84c1b971ef374181bb6cfa9af200ef80279384 100644 (file)
@@ -355,8 +355,10 @@ public class OwnershipGraph {
        HeapRegionNode hrnHrn  = edgeHrn.getDst();
        ReachabilitySet betaHrn = edgeHrn.getBeta();
 
-       if( edgeHrn.getType() == null ||
-           edgeHrn.getType().equals( f.getType() ) ) {
+       if( edgeHrn.getType() == null ||            
+           (edgeHrn.getType() .equals( f.getType()   ) &&
+            edgeHrn.getField().equals( f.getSymbol() )    )
+         ) {
 
          ReferenceEdge edgeNew = new ReferenceEdge(lnX,
                                                    hrnHrn,
@@ -381,11 +383,6 @@ public class OwnershipGraph {
     HashSet<HeapRegionNode> nodesWithNewAlpha = new HashSet<HeapRegionNode>();
     HashSet<ReferenceEdge>  edgesWithNewBeta  = new HashSet<ReferenceEdge>();
 
-
-    
-    //boolean printDebug = f.getType()    
-
-
     // first look for possible strong updates and remove those edges
     boolean strongUpdate = false;