//rg.abstractGarbageCollect();
//rg.globalSweep();
-
+
// at this point rg should be the correct update
// by an above transfer function, or untouched if
// the flat node type doesn't affect the heap
false, // out-of-context?
as.getType(), // type
as, // allocation site
- null, // inherent reach
+ alpha, // inherent reach
alpha, // current reach
ExistPredSet.factory(rg.predTrue), // predicates
tempDesc.toString() // description
false, // out-of-context?
typeDesc, // type
as, // allocation site
- null, // inherent reach
+ alpha, // inherent reach
alpha, // current reach
ExistPredSet.factory(rg.predTrue), // predicates
tempDesc.toString() // description
VariableNode lnX = rg.getVariableNodeFromTemp(tempDesc);
Integer idNewest = as.getIthOldest(0);
HeapRegionNode hrnNewest = rg.id2hrn.get(idNewest);
+
// make a new reference to allocated node
RefEdge edgeNew = new RefEdge(lnX, // source
hrnNewest, // dest
ExistPredSet.factory(rg.predTrue) // predicates
);
rg.addRefEdge(lnX, hrnNewest, edgeNew);
-
+
// set-up a work set for class field
ClassDescriptor classDesc = paramTypeDesc.getClassDesc();
for (Iterator it = classDesc.getFields(); it.hasNext();) {
false, // out-of-context?
allocSite.getType(), // type
allocSite, // allocation site
- null, // inherent reach
+ hrnNewest.getAlpha(), // inherent reach
hrnNewest.getAlpha(), // current reach
ExistPredSet.factory(rg.predTrue), // predicates
strDesc // description
stateCaller
);
}
- }
+ }
}
assert out.isCanonical();
}
}
}
- /*
- // test param -> HRN edges, also
- for( int i = 0; i < fmCallee.numParameters(); ++i ) {
-
- // parameter defined here is the symbol in the callee
- TempDescriptor tdParam = fmCallee.getParameter( i );
-
- if( !DisjointAnalysis.shouldAnalysisTrack( tdParam.getType() ) ) {
- // skip primitive/immutable parameters
- continue;
- }
-
- VariableNode vnCallee = rgCallee.getVariableNodeFromTemp( tdParam );
-
- Iterator<RefEdge> reItr = vnCallee.iteratorToReferencees();
- while( reItr.hasNext() ) {
- RefEdge reCallee = reItr.next();
-
- ExistPredSet ifDst =
- reCallee.getDst().getPreds().isSatisfiedBy( this,
- callerNodeIDsCopiedToCallee
- );
- if( ifDst == null ) {
- continue;
- }
-
- ExistPredSet predsIfSatis =
- reCallee.getPreds().isSatisfiedBy( this,
- callerNodeIDsCopiedToCallee
- );
- if( predsIfSatis != null ) {
- calleeEdgesSatisfied.put( reCallee, predsIfSatis );
-
- // since the edge is coming over, find out which reach
- // states on it should come over, too
- Iterator<ReachState> stateItr = reCallee.getBeta().iterator();
- while( stateItr.hasNext() ) {
- ReachState stateCallee = stateItr.next();
-
- predsIfSatis =
- stateCallee.getPreds().isSatisfiedBy( this,
- callerNodeIDsCopiedToCallee
- );
- if( predsIfSatis != null ) {
- calleeStatesSatisfied.put( stateCallee, predsIfSatis );
- }
- }
-
- }
- }
- }*/
-
-
-
if( writeDebugDOTs ) {
writeGraph( debugGraphPrefix+"caller20BeforeWipe",
}
+
+
// 3. callee elements with satisfied preds come in, note that
// the mapping of elements satisfied to preds is like this:
// A callee element EE has preds EEp that are satisfied by
+
+
if( writeDebugDOTs ) {
writeGraph( debugGraphPrefix+"caller31BeforeAddingEdges",
resolveMethodDebugDOTwriteLabels,
-
if( writeDebugDOTs ) {
writeGraph( debugGraphPrefix+"caller35BeforeAssignReturnValue",
resolveMethodDebugDOTwriteLabels,
+
if( writeDebugDOTs ) {
writeGraph( debugGraphPrefix+"caller40BeforeShadowMerge",
resolveMethodDebugDOTwriteLabels,
}
+
+
+
+
if( writeDebugDOTs ) {
writeGraph( debugGraphPrefix+"caller45BeforeUnshadow",
resolveMethodDebugDOTwriteLabels,
+
if( writeDebugDOTs ) {
writeGraph( debugGraphPrefix+"caller50BeforeGlobalSweep",
resolveMethodDebugDOTwriteLabels,
+
+
if( writeDebugDOTs ) {
writeGraph( debugGraphPrefix+"caller90AfterTransfer",
resolveMethodDebugDOTwriteLabels,
// any node should name a node that is
// part of the graph
public boolean inContextTuplesInGraph() {
+
Iterator hrnItr = id2hrn.entrySet().iterator();
while( hrnItr.hasNext() ) {
Map.Entry me = (Map.Entry) hrnItr.next();
}
+ // another useful assertion for debugging
+ public boolean noEmptyReachSetsInGraph() {
+
+ Iterator hrnItr = id2hrn.entrySet().iterator();
+ while( hrnItr.hasNext() ) {
+ Map.Entry me = (Map.Entry) hrnItr.next();
+ HeapRegionNode hrn = (HeapRegionNode) me.getValue();
+
+ if( !hrn.isOutOfContext() &&
+ !hrn.isWiped() &&
+ hrn.getAlpha().isEmpty()
+ ) {
+ System.out.println( "!!! "+hrn+" has an empty ReachSet !!!" );
+ return false;
+ }
+
+ Iterator<RefEdge> edgeItr = hrn.iteratorToReferencers();
+ while( edgeItr.hasNext() ) {
+ RefEdge edge = edgeItr.next();
+
+ if( edge.getBeta().isEmpty() ) {
+ System.out.println( "!!! "+edge+" has an empty ReachSet !!!" );
+ return false;
+ }
+ }
+ }
+
+ return true;
+ }
+
+
+ public boolean everyReachStateWTrue() {
+
+ Iterator hrnItr = id2hrn.entrySet().iterator();
+ while( hrnItr.hasNext() ) {
+ Map.Entry me = (Map.Entry) hrnItr.next();
+ HeapRegionNode hrn = (HeapRegionNode) me.getValue();
+
+ {
+ Iterator<ReachState> stateItr = hrn.getAlpha().iterator();
+ while( stateItr.hasNext() ) {
+ ReachState state = stateItr.next();
+
+ if( !state.getPreds().equals( predsTrue ) ) {
+ return false;
+ }
+ }
+ }
+
+ Iterator<RefEdge> edgeItr = hrn.iteratorToReferencers();
+ while( edgeItr.hasNext() ) {
+ RefEdge edge = edgeItr.next();
+
+ Iterator<ReachState> stateItr = edge.getBeta().iterator();
+ while( stateItr.hasNext() ) {
+ ReachState state = stateItr.next();
+
+ if( !state.getPreds().equals( predsTrue ) ) {
+ return false;
+ }
+ }
+ }
+ }
+
+ return true;
+ }
+
+
////////////////////////////////////////////////////