From 727c099c76c0bf945011bdf37ce0a4f45df4ce76 Mon Sep 17 00:00:00 2001 From: jjenista Date: Fri, 2 Apr 2010 22:28:51 +0000 Subject: [PATCH] bug fixes for unflagged heap regions becoming flagged --- Robust/src/Analysis/Disjoint/AllocSite.java | 14 +++---- .../Analysis/Disjoint/DisjointAnalysis.java | 18 ++++----- Robust/src/Analysis/Disjoint/ReachGraph.java | 38 +++---------------- 3 files changed, 18 insertions(+), 52 deletions(-) diff --git a/Robust/src/Analysis/Disjoint/AllocSite.java b/Robust/src/Analysis/Disjoint/AllocSite.java index c0dcf3ab..5d5fea81 100644 --- a/Robust/src/Analysis/Disjoint/AllocSite.java +++ b/Robust/src/Analysis/Disjoint/AllocSite.java @@ -139,6 +139,10 @@ public class AllocSite extends Canonical { return flatNew.getType(); } + public boolean isFlagged() { + return isFlagged; + } + public int getAgeCategory( Integer id ) { if( id.equals( summary ) ) { @@ -263,13 +267,5 @@ public class AllocSite extends Canonical { public int hashCodeSpecific() { return id; - } - - public void setFlag( boolean flag ) { - this.isFlagged = flag; - } - - public boolean getFlag() { - return isFlagged; - } + } } diff --git a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java index 952d2377..b073e3ab 100644 --- a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java +++ b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java @@ -1253,12 +1253,10 @@ public class DisjointAnalysis { protected AllocSite getAllocSiteFromFlatNewPRIVATE( FlatNew fnew ) { if( !mapFlatNewToAllocSite.containsKey( fnew ) ) { - AllocSite as = - (AllocSite) Canonical.makeCanonical( new AllocSite( allocationDepth, - fnew, - fnew.getDisjointId() - ) - ); + AllocSite as = AllocSite.factory( allocationDepth, + fnew, + fnew.getDisjointId() + ); // the newest nodes are single objects for( int i = 0; i < allocationDepth; ++i ) { @@ -1512,7 +1510,10 @@ public class DisjointAnalysis { "param"+tempDesc // disjoint site ID string ); // create allocation site - AllocSite as = (AllocSite) Canonical.makeCanonical(new AllocSite( allocationDepth, flatNew, flatNew.getDisjointId())); + AllocSite as = AllocSite.factory( allocationDepth, + flatNew, + flatNew.getDisjointId() + ); for (int i = 0; i < allocationDepth; ++i) { Integer id = generateUniqueHeapRegionNodeID(); as.setIthOldest(i, id); @@ -1566,7 +1567,6 @@ private Set getFieldSetTobeAnalyzed(TypeDescriptor typeDesc){ rg.createNewHeapRegionNode(as.getSummary(), // id or null to generate a new one false, // single object? true, // summary? - false, // flagged? false, // out-of-context? as.getType(), // type as, // allocation site @@ -1624,7 +1624,6 @@ private Set getFieldSetTobeAnalyzed(TypeDescriptor typeDesc){ rg.createNewHeapRegionNode(as.getSummary(), // id or null to generate a new one false, // single object? true, // summary? - false, // flagged? false, // out-of-context? typeDesc, // type as, // allocation site @@ -1748,7 +1747,6 @@ private ReachGraph createInitialTaskReachGraph(FlatMethod fm) { rg.createNewHeapRegionNode(allocSite.getSummary(), // id or null to generate a new one false, // single object? true, // summary? - false, // flagged? false, // out-of-context? allocSite.getType(), // type allocSite, // allocation site diff --git a/Robust/src/Analysis/Disjoint/ReachGraph.java b/Robust/src/Analysis/Disjoint/ReachGraph.java index 2ff8e0c8..e6b531fc 100644 --- a/Robust/src/Analysis/Disjoint/ReachGraph.java +++ b/Robust/src/Analysis/Disjoint/ReachGraph.java @@ -92,7 +92,6 @@ public class ReachGraph { createNewHeapRegionNode( Integer id, boolean isSingleObject, boolean isNewSummary, - boolean isFlagged, boolean isOutOfContext, TypeDescriptor type, AllocSite allocSite, @@ -102,8 +101,6 @@ public class ReachGraph { String description ) { - boolean markForAnalysis = isFlagged; - TypeDescriptor typeToUse = null; if( allocSite != null ) { typeToUse = allocSite.getType(); @@ -112,15 +109,15 @@ public class ReachGraph { typeToUse = type; } - if( allocSite != null && allocSite.getDisjointAnalysisId() != null ) { + boolean markForAnalysis = false; + if( allocSite != null && allocSite.isFlagged() ) { markForAnalysis = true; } - - + if( allocSite == null ) { assert !markForAnalysis; - } else if( markForAnalysis != allocSite.getFlag() ) { + } else if( markForAnalysis != allocSite.isFlagged() ) { assert false; } @@ -798,22 +795,12 @@ public class ReachGraph { if( hrnSummary == null ) { - boolean hasFlags = false; - if( as.getType().isClass() ) { - hasFlags = as.getType().getClassDesc().hasFlags(); - } - - if( as.getFlag() ){ - hasFlags = true; - } - String strDesc = as.toStringForDOT()+"\\nsummary"; hrnSummary = createNewHeapRegionNode( idSummary, // id or null to generate a new one false, // single object? - true, // summary? - hasFlags, // flagged? + true, // summary? false, // out-of-context? as.getType(), // type as, // allocation site @@ -843,21 +830,11 @@ public class ReachGraph { if( hrnIth == null ) { - boolean hasFlags = false; - if( as.getType().isClass() ) { - hasFlags = as.getType().getClassDesc().hasFlags(); - } - - if( as.getFlag() ){ - hasFlags = true; - } - String strDesc = as.toStringForDOT()+"\\n"+i+" oldest"; hrnIth = createNewHeapRegionNode( idIth, // id or null to generate a new one true, // single object? false, // summary? - hasFlags, // flagged? false, // out-of-context? as.getType(), // type as, // allocation site @@ -1613,7 +1590,6 @@ public class ReachGraph { rg.createNewHeapRegionNode( hrnCaller.getID(), hrnCaller.isSingleObject(), hrnCaller.isNewSummary(), - hrnCaller.isFlagged(), false, // out-of-context? hrnCaller.getType(), hrnCaller.getAllocSite(), @@ -1805,7 +1781,6 @@ public class ReachGraph { rg.createNewHeapRegionNode( null, // ID false, // single object? false, // new summary? - false, // flagged? true, // out-of-context? oocNodeType, null, // alloc site, shouldn't be used @@ -1834,7 +1809,6 @@ public class ReachGraph { rg.createNewHeapRegionNode( oocHrnID, // ID false, // single object? false, // new summary? - false, // flagged? true, // out-of-context? oocNodeType, null, // alloc site, shouldn't be used @@ -2225,7 +2199,6 @@ public class ReachGraph { createNewHeapRegionNode( hrnIDshadow, // id or null to generate a new one hrnCallee.isSingleObject(), // single object? hrnCallee.isNewSummary(), // summary? - hrnCallee.isFlagged(), // flagged? false, // out-of-context? hrnCallee.getType(), // type hrnCallee.getAllocSite(), // allocation site @@ -2492,7 +2465,6 @@ public class ReachGraph { createNewHeapRegionNode( hrnIDDstShadow, // id or null to generate a new one hrnDstCallee.isSingleObject(), // single object? hrnDstCallee.isNewSummary(), // summary? - hrnDstCallee.isFlagged(), // flagged? false, // out-of-context? hrnDstCallee.getType(), // type hrnDstCallee.getAllocSite(), // allocation site -- 2.34.1