addReferenceEdge( hrn, hrnSrc, repNew );
-
-
ChangeTupleSet Cy = O.unionUpArityToChangeSet( R );
- //ChangeTupleSet Cx = R.unionUpArityToChangeSet( O );
propagateTokens( hrnSrc, Cy, nodesWithNewAlpha, edgesWithNewBeta );
- //propagateTokens( hrn, Cx, nodesWithNewAlpha, edgesWithNewBeta );
-
- /*
- // note that this picks up the beta after the propogation has
- // been applied
- ReferenceEdgeProperties repNew
- = new ReferenceEdgeProperties( false, false, repSrc.getBetaNew() );
-
- addReferenceEdge( hrn, hrnSrc, repNew );
- */
}
}
Map.Entry me = (Map.Entry) itrReferencee.next();
hrnReferencee = (HeapRegionNode) me.getKey();
ReferenceEdgeProperties rep = (ReferenceEdgeProperties) me.getValue();
-
- // determine if another summary node is already referencing this referencee
- /*
- boolean hasSummaryReferencer = false;
- OwnershipNode onReferencer = null;
- Iterator itrReferencer = hrnReferencee.iteratorToReferencers();
- while( itrReferencer.hasNext() ) {
- onReferencer = (OwnershipNode) itrReferencer.next();
- if( onReferencer instanceof HeapRegionNode ) {
- HeapRegionNode hrnPossibleSummary = (HeapRegionNode) onReferencer;
- if( hrnPossibleSummary.isNewSummary() ) {
- hasSummaryReferencer = true;
- }
- }
- }
-
- addReferenceEdge( hrnSummary,
- hrnReferencee,
- new ReferenceEdgeProperties( !hasSummaryReferencer ) );
- */
ReferenceEdgeProperties repSummary = hrnSummary.getReferenceTo( hrnReferencee );
ReferenceEdgeProperties repMerged = rep.copy();
addReferenceEdge( onReferencer, hrnSummary, repMerged );
}
+ // then merge alpha_k reachability into alpha_s
+ hrnSummary.setAlpha( hrnSummary.getAlpha().union( hrnK.getAlpha() ) );
+
// then move down the line of heap region nodes
// clobbering the ith and transferring all references
addReferenceEdge( onReferencer, hrnI, rep.copy() );
}
+
+ // replace hrnI reachability with hrnImin1
+ hrnI.setAlpha( hrnImin1.getAlpha() );
}
// as stated above, the newest node alpha_0 should have had its
// have touched this node, therefore assert it is non-null
assert hrn0 != null;
+
// clear all references in and out of newest node
clearReferenceEdgesFrom( hrn0 );
clearReferenceEdgesTo ( hrn0 );
+
- /*
// now tokens in reachability sets need to "age" as well
ReferenceEdgeProperties repToAge = null;
Iterator itrAllLabelNodes = td2ln.entrySet().iterator();
ageTokens( as, repToAge );
}
}
-
HeapRegionNode hrnToAge = null;
Iterator itrAllHRNodes = id2hrn.entrySet().iterator();
while( itrAllHRNodes.hasNext() ) {
ageTokens( as, repToAge );
}
}
- */
-
+
+
+ // after tokens have been aged, reset newest node's reachability
+ hrn0.setAlpha( new ReachabilitySet(
+ new TokenTupleSet(
+ new TokenTuple( hrn0 )
+ )
+ ).makeCanonical()
+ );
}
protected void ageTokens( AllocationSite as, ReferenceEdgeProperties rep ) {
//System.out.println( "idCallee is "+idCallee );
//System.out.println( "idChildCallee is "+idChildCallee );
- try {
- writeGraph( "caller", false, false );
- ogCallee.writeGraph( "callee", false, false );
+ try {
+ writeGraph( "caller", false, false, false );
+ ogCallee.writeGraph( "callee", false, false, false );
} catch( IOException e ) {}
}
// for writing ownership graphs to dot files
+ public void writeGraph( Descriptor methodDesc,
+ FlatNode fn,
+ boolean writeLabels,
+ boolean labelSelect,
+ boolean writeReferencers
+ ) throws java.io.IOException {
+ writeGraph(
+ methodDesc.getSymbol() +
+ methodDesc.getNum() +
+ fn.toString(),
+ writeLabels,
+ labelSelect,
+ writeReferencers
+ );
+ }
+
public void writeGraph( Descriptor methodDesc,
FlatNode fn,
boolean writeLabels,
methodDesc.getNum() +
fn.toString(),
writeLabels,
+ false,
writeReferencers
);
}
methodDesc.getNum() +
"COMPLETE",
writeLabels,
+ false,
+ writeReferencers
+ );
+ }
+
+ public void writeGraph( Descriptor methodDesc,
+ boolean writeLabels,
+ boolean labelSelect,
+ boolean writeReferencers
+ ) throws java.io.IOException {
+ writeGraph(
+ methodDesc.getSymbol() +
+ methodDesc.getNum() +
+ "COMPLETE",
+ writeLabels,
+ labelSelect,
writeReferencers
);
}
public void writeGraph( String graphName,
boolean writeLabels,
+ boolean labelSelect,
boolean writeReferencers
) throws java.io.IOException {
Map.Entry me = (Map.Entry) i.next();
LabelNode ln = (LabelNode) me.getValue();
+ if( labelSelect ) {
+ String labelStr = ln.getTempDescriptorString();
+ if( labelStr.startsWith( "___temp" ) ||
+ labelStr.startsWith( "___dst" ) ||
+ labelStr.startsWith( "___srctmp" ) ||
+ labelStr.startsWith( "___neverused" ) ) {
+ continue;
+ }
+ }
+
HeapRegionNode hrn = null;
Iterator heapRegionsItr = ln.setIteratorToReferencedRegions();
while( heapRegionsItr.hasNext() ) {
return tokenTuples.iterator();
}
+ /*
public TokenTupleSet add( TokenTuple tt ) {
TokenTupleSet ttsOut = new TokenTupleSet( tt );
return this.union( ttsOut );
}
+ */
public TokenTupleSet union( TokenTupleSet ttsIn ) {
TokenTupleSet ttsOut = new TokenTupleSet( this );
}
public TokenTupleSet ageTokens( AllocationSite as ) {
- TokenTupleSet ttsOut = new TokenTupleSet( this );
+ TokenTupleSet ttsOut = new TokenTupleSet();
TokenTuple ttSummary = null;
boolean foundOldest = false;
// summary tokens and tokens not associated with
// the site should be left alone
- if( age != AllocationSite.AGE_notInThisSite ) {
+ if( age == AllocationSite.AGE_notInThisSite ) {
+ ttsOut.tokenTuples.add( tt );
+ } else {
if( age == AllocationSite.AGE_summary ) {
// remember the summary tuple, but don't add it
// we may combine it with the oldest tuple
ttSummary = tt;
} else if( age == AllocationSite.AGE_oldest ) {
- // found a token
+ // found an oldest token, again just remember
+ // for later
foundOldest = true;
} else {
// otherwise, we change this token to the
// next older token
Integer tokenToChangeTo = as.getIthOldest( age + 1 );
- tt = tt.changeTokenTo( tokenToChangeTo );
+ TokenTuple ttAged = tt.changeTokenTo( tokenToChangeTo );
+ ttsOut.tokenTuples.add( ttAged );
}
- }
- ttsOut.add( tt );
+ }
}
// there are four cases to consider here
// Merge them by increasing arity of summary
// 4. (not handled) we found neither, do nothing
if ( ttSummary != null && !foundOldest ) {
- ttsOut.add( ttSummary );
+ ttsOut.tokenTuples.add( ttSummary );
} else if( ttSummary == null && foundOldest ) {
- ttsOut.add( new TokenTuple( as.getSummary(),
+ ttsOut.tokenTuples.add( new TokenTuple( as.getSummary(),
true,
TokenTuple.ARITY_ONE ).makeCanonical() );
} else if( ttSummary != null && foundOldest ) {
- ttsOut.add( ttSummary.increaseArity() );
+ ttsOut.tokenTuples.add( ttSummary.increaseArity() );
}
return ttsOut.makeCanonical();