From 04c760d1e6f72f35130fd405a9e6955f93fbe79a Mon Sep 17 00:00:00 2001 From: jjenista Date: Mon, 10 Nov 2008 23:55:42 +0000 Subject: [PATCH] eliminate two erroneous statements in callee->caller node creation --- .../OwnershipAnalysis/OwnershipGraph.java | 34 ++++++++++++++++--- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java index 95c7c4f0..fa51004e 100644 --- a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java +++ b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java @@ -882,7 +882,7 @@ public class OwnershipGraph { protected void transferOnto(HeapRegionNode hrnA, HeapRegionNode hrnB) { - // clear references in and out of node i + // clear references in and out of node b clearReferenceEdgesFrom(hrnB, null, true); clearReferenceEdgesTo(hrnB, null, true); @@ -1215,6 +1215,31 @@ public class OwnershipGraph { } + + + // check for parameters that are aliased prior to this call site + // if so, come to a grinding halt. Later, we should move this + // up before doing any alpha/beta updates + for( int i = 0; i < fm.numParameters(); ++i ) { + for( int j = 0; j < i; ++j ) { + HashSet s1 = paramIndex2reachableCallerNodes.get( i ); + HashSet s2 = paramIndex2reachableCallerNodes.get( j ); + + Set intersection = new HashSet(s1); + intersection.retainAll(s2); + + if( !intersection.isEmpty() ) { + // uh oh + System.out.println( " Arguments "+j+" and "+i+" are aliased just before" ); + System.out.println( " "+fc+" calls "+fm+"\n" ); + //System.exit( -1 ); + } + } + } + + + + // verify the existence of allocation sites and their // shadows from the callee in the context of this caller graph // then map allocated nodes of callee onto the caller shadows @@ -1222,6 +1247,9 @@ public class OwnershipGraph { Iterator asItr = ogCallee.allocationSites.iterator(); while( asItr.hasNext() ) { AllocationSite allocSite = asItr.next(); + + // grab the summary in the caller just to make sure + // the allocation site has nodes in the caller HeapRegionNode hrnSummary = getSummaryNode(allocSite); // assert that the shadow nodes have no reference edges @@ -1232,8 +1260,6 @@ public class OwnershipGraph { assert hrnShadowSummary.getNumReferencees() == 0; // then bring g_ij onto g'_ij and rewrite - transferOnto(hrnSummary, hrnShadowSummary); - HeapRegionNode hrnSummaryCallee = ogCallee.getSummaryNode(allocSite); hrnShadowSummary.setAlpha(toShadowTokens(ogCallee, hrnSummaryCallee.getAlpha() ) ); @@ -1267,8 +1293,6 @@ public class OwnershipGraph { assert hrnIthShadow.getNumReferencers() == 0; assert hrnIthShadow.getNumReferencees() == 0; - transferOnto(hrnIth, hrnIthShadow); - assert ogCallee.id2hrn.containsKey(idIth); HeapRegionNode hrnIthCallee = ogCallee.id2hrn.get(idIth); hrnIthShadow.setAlpha(toShadowTokens(ogCallee, hrnIthCallee.getAlpha() ) ); -- 2.34.1