From 2a1fa9dd1b1a9c0c90a2492d6913ce971791871d Mon Sep 17 00:00:00 2001 From: jjenista Date: Mon, 14 Sep 2009 22:25:47 +0000 Subject: [PATCH] fix for x = y.f statements copying by type and ignoring field name --- .../OwnershipAnalysis/OwnershipAnalysis.java | 41 +++++++++++++++++++ .../OwnershipAnalysis/OwnershipGraph.java | 11 ++--- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java b/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java index df464d43..276890f2 100644 --- a/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java +++ b/Robust/src/Analysis/OwnershipAnalysis/OwnershipAnalysis.java @@ -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 possible( TempDescriptor temp, + FlatNode ppoint ) { + assert temp != null; + assert ppoint != null; + + /* + OwnershipGraph og = new OwnershipGraph( allocationDepth, typeUtil ); + + assert mapDescriptorToAllMethodContexts.containsKey( d ); + HashSet contexts = mapDescriptorToAllMethodContexts.get( d ); + Iterator 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 diff --git a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java index 58c38d0e..ed84c1b9 100644 --- a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java +++ b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java @@ -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 nodesWithNewAlpha = new HashSet(); HashSet edgesWithNewBeta = new HashSet(); - - - //boolean printDebug = f.getType() - - // first look for possible strong updates and remove those edges boolean strongUpdate = false; -- 2.34.1