protected AllocationSite allocSite;
+ protected ReachabilitySet alpha;
+
protected String description;
- public HeapRegionNode( Integer id,
- boolean isSingleObject,
- boolean isFlagged,
- boolean isNewSummary,
- AllocationSite allocSite,
- String description ) {
+ public HeapRegionNode( Integer id,
+ boolean isSingleObject,
+ boolean isFlagged,
+ boolean isNewSummary,
+ AllocationSite allocSite,
+ ReachabilitySet alpha,
+ String description ) {
this.id = id;
this.isSingleObject = isSingleObject;
this.isFlagged = isFlagged;
this.isNewSummary = isNewSummary;
this.allocSite = allocSite;
+ this.alpha = alpha;
this.description = description;
referencers = new HashSet<OwnershipNode>();
isFlagged,
isNewSummary,
allocSite,
+ alpha,
description );
}
return allocSite;
}
+
+ public ReachabilitySet getAlpha() {
+ return alpha;
+ }
+
+
public String getIDString() {
return id.toString();
}
+ public String getAlphaString() {
+ return alpha.toStringEscapeNewline();
+ }
+
public String toString() {
return "HRN"+getIDString();
}
public HashSet<AllocationSite> allocationSites;
// CHANGE! Map HRN ID's to token sets (sets of IDs!)
- public Hashtable< HeapRegionNode, HashSet< HashSet<HeapRegionNode> > > alpha;
- //public Hashtable< touple< HRN, HRN >, HashSet< HashSet<HeapRegionNode> > > beta;
+ //public Hashtable< HeapRegionNode, HashSet< HashSet<HeapRegionNode> > > alpha;
+ //public Hashtable< touple< HRN, HRN >, HashSet< HashSet<HeapRegionNode> > > beta;
public OwnershipGraph( int allocationDepth ) {
allocationSites = new HashSet <AllocationSite>();
- alpha = new Hashtable< HeapRegionNode, HashSet< HashSet<HeapRegionNode> > >();
+ //alpha = new Hashtable< HeapRegionNode, HashSet< HashSet<HeapRegionNode> > >();
}
// in the merge() operation) or to create new heap
// regions with a new unique ID.
protected HeapRegionNode
- createNewHeapRegionNode( Integer id,
- boolean isSingleObject,
- boolean isFlagged,
- boolean isNewSummary,
- AllocationSite allocSite,
- String description ) {
+ createNewHeapRegionNode( Integer id,
+ boolean isSingleObject,
+ boolean isFlagged,
+ boolean isNewSummary,
+ boolean isParameter,
+ AllocationSite allocSite,
+ ReachabilitySet alpha,
+ String description ) {
if( id == null ) {
id = OwnershipAnalysis.generateUniqueHeapRegionNodeID();
}
+ if( alpha == null ) {
+ if( isFlagged || isParameter ) {
+ alpha = new ReachabilitySet( new TokenTuple( id,
+ isNewSummary,
+ TokenTuple.ARITY_ONE ) );
+ } else {
+ alpha = new ReachabilitySet();
+ }
+ }
+
HeapRegionNode hrn = new HeapRegionNode( id,
isSingleObject,
isFlagged,
isNewSummary,
allocSite,
+ alpha,
description );
id2hrn.put( id, hrn );
return hrn;
false,
isTask,
false,
+ true,
+ null,
null,
"param" + paramIndex );
false,
hasFlags,
true,
+ false,
as,
+ null,
as + "\\n" + as.getType() + "\\nsummary" );
for( int i = 0; i < as.getAllocationDepth(); ++i ) {
true,
hasFlags,
false,
+ false,
as,
+ null,
as + "\\n" + as.getType() + "\\n" + i + " oldest" );
}
}
mergeReferenceEdges ( og );
mergeId2paramIndex ( og );
mergeAllocationSites( og );
- mergeTokenSets ( og );
+ //mergeTokenSets ( og );
}
protected void mergeOwnershipNodes( OwnershipGraph og ) {
- protected void mergeTokenSets( OwnershipGraph og ) {
+ //protected void mergeTokenSets( OwnershipGraph og ) {
// alpha = new Hashtable< HeapRegionNode, HashSet< HashSet<HeapRegionNode> > >();
// if a key is in one or the other token set,
}
}
*/
- }
+ //}
hrn.getID() +
"\\n" +
hrn.getDescription() +
+ "\\n" +
+ hrn.getAlphaString() +
"\"]";
bw.write( " " + hrn.toString() + attributes + ";\n" );
possibleReachabilities.add( tts );
}
+ public ReachabilitySet( TokenTuple tt ) {
+ this( new TokenTupleSet( tt ) );
+ }
+
public ReachabilitySet( ReachabilitySet rs ) {
possibleReachabilities = (HashSet<TokenTupleSet>) rs.possibleReachabilities.clone(); // again, DEEP COPY?!
}
if( !theUnion.isEmpty() ) {
ctsOut = ctsOut.union(
- new ChangeTupleSet(
- new ChangeTuple( o, theUnion )
- )
+ new ChangeTupleSet( new ChangeTuple( o, theUnion ) )
);
}
}
return ctsOut;
}
+
+ public String toStringEscapeNewline() {
+ String s = "[";
+
+ Iterator i = this.iterator();
+ while( i.hasNext() ) {
+ s += "\\n "+i.next();
+ }
+
+ s += "]";
+
+ return s;
+ }
+
+
public String toString() {
String s = "[";