System.out.println( treport );
if( writeFinalDOTs && !writeAllIncrementalDOTs ) {
- //writeFinalContextGraphs();
+ writeFinalGraphs();
}
if( state.DISJOINTALIASFILE != null ) {
// states after the flat method returns
ReachGraph completeGraph = new ReachGraph();
+ assert !setReturns.isEmpty();
Iterator retItr = setReturns.iterator();
while( retItr.hasNext() ) {
FlatReturnNode frn = (FlatReturnNode) retItr.next();
+
assert mapFlatNodeToReachGraph.containsKey( frn );
ReachGraph rgRet = mapFlatNodeToReachGraph.get( frn );
+
completeGraph.merge( rgRet );
}
protected void
- analyzeFlatNode( Descriptor d,
- FlatMethod fmContaining,
- FlatNode fn,
+ analyzeFlatNode( Descriptor d,
+ FlatMethod fmContaining,
+ FlatNode fn,
HashSet<FlatReturnNode> setRetNodes,
- ReachGraph rg
+ ReachGraph rg
) throws java.io.IOException {
// rg.nullifyDeadVars( liveness.getLiveInTemps( fmContaining, fn ) );
- TempDescriptor lhs;
- TempDescriptor rhs;
+ TempDescriptor lhs;
+ TempDescriptor rhs;
FieldDescriptor fld;
// use node type to decide what transfer function
}
- /*
- private void writeFinalContextGraphs() {
- Set entrySet = mapDescriptorToCompleteReachabilityGraph.entrySet();
+
+ private void writeFinalGraphs() {
+ Set entrySet = mapDescriptorToCompleteReachGraph.entrySet();
Iterator itr = entrySet.iterator();
while( itr.hasNext() ) {
- Map.Entry me = (Map.Entry) itr.next();
- Descriptor mc = (Descriptor) me.getKey();
- ReachabilityGraph og = (ReachabilityGraph) me.getValue();
-
- try {
- og.writeGraph(mc+"COMPLETE",
- true, // write labels (variables)
- true, // selectively hide intermediate temp vars
- true, // prune unreachable heap regions
- false, // show back edges to confirm graph validity
- false, // show parameter indices (unmaintained!)
- true, // hide subset reachability states
- true); // hide edge taints
+ Map.Entry me = (Map.Entry) itr.next();
+ Descriptor d = (Descriptor) me.getKey();
+ ReachGraph rg = (ReachGraph) me.getValue();
+
+ try {
+ rg.writeGraph( d+"COMPLETE",
+ true, // write labels (variables)
+ true, // selectively hide intermediate temp vars
+ true, // prune unreachable heap regions
+ false, // show back edges to confirm graph validity
+ true, // hide subset reachability states
+ true ); // hide edge taints
} catch( IOException e ) {}
}
}
-
- */
+
// return just the allocation site associated with one FlatNew node
protected AllocSite getAllocSiteFromFlatNewPRIVATE( FlatNew fnew ) {
"analysisEntryMethod"
);
- TempDescriptor cmdLineArgs = new TempDescriptor( "args" );
-
- FlatNew fn = new FlatNew( mdSourceEntry.getParamType( 0 ),
- cmdLineArgs,
- false // is global
- );
+ TempDescriptor cmdLineArgs =
+ new TempDescriptor( "args",
+ mdSourceEntry.getParamType( 0 )
+ );
+
+ FlatNew fn =
+ new FlatNew( mdSourceEntry.getParamType( 0 ),
+ cmdLineArgs,
+ false // is global
+ );
TempDescriptor[] sourceEntryArgs = new TempDescriptor[1];
sourceEntryArgs[0] = cmdLineArgs;
- FlatCall fc = new FlatCall( mdSourceEntry,
- null, // dst temp
- null, // this temp
- sourceEntryArgs
- );
+ FlatCall fc =
+ new FlatCall( mdSourceEntry,
+ null, // dst temp
+ null, // this temp
+ sourceEntryArgs
+ );
+
+ FlatReturnNode frn = new FlatReturnNode( null );
FlatExit fe = new FlatExit();
- this.fmAnalysisEntry = new FlatMethod( mdAnalysisEntry, fe );
+ this.fmAnalysisEntry =
+ new FlatMethod( mdAnalysisEntry,
+ fe
+ );
this.fmAnalysisEntry.addNext( fn );
fn.addNext( fc );
- fc.addNext( fe );
+ fc.addNext( frn );
+ frn.addNext( fe );
}
// Low-level referencee and referencer methods
//
// These methods provide the lowest level for
- // creating references between ownership nodes
+ // creating references between reachability nodes
// and handling the details of maintaining both
// list of referencers and referencees.
//
public void assignTempEqualToNewAlloc( TempDescriptor x,
- AllocSite as ) {
+ AllocSite as ) {
assert x != null;
assert as != null;
// use the allocation site (unique to entire analysis) to
- // locate the heap region nodes in this ownership graph
+ // locate the heap region nodes in this reachability graph
// that should be aged. The process models the allocation
// of new objects and collects all the oldest allocations
// in a summary node to allow for a finite analysis
//
// There is an additional property of this method. After
- // running it on a particular ownership graph (many graphs
+ // running it on a particular reachability graph (many graphs
// may have heap regions related to the same allocation site)
- // the heap region node objects in this ownership graph will be
+ // the heap region node objects in this reachability graph will be
// allocated. Therefore, after aging a graph for an allocation
// site, attempts to retrieve the heap region nodes using the
// integer id's contained in the allocation site should always
allocSites.add( as );
// get the summary node for the allocation site in the context
- // of this particular ownership graph
+ // of this particular reachability graph
HeapRegionNode hrnSummary = getSummaryNode( as );
// merge oldest node into summary
HeapRegionNode hrnSummary = id2hrn.get( idSummary );
// If this is null then we haven't touched this allocation site
- // in the context of the current ownership graph, so allocate
+ // in the context of the current reachability graph, so allocate
// heap region nodes appropriate for the entire allocation site.
- // This should only happen once per ownership graph per allocation site,
+ // This should only happen once per reachability graph per allocation site,
// and a particular integer id can be used to locate the heap region
- // in different ownership graphs that represents the same part of an
+ // in different reachability graphs that represents the same part of an
// allocation site.
if( hrnSummary == null ) {
public void resolveMethodCall(FlatCall fc, // call site in caller method
boolean isStatic, // whether it is a static method
FlatMethod fm, // the callee method (when virtual, can be many)
- ReachGraph ogCallee, // the callee's current ownership graph
+ ReachGraph ogCallee, // the callee's current reachability graph
MethodContext mc, // the aliasing context for this call
ParameterDecomposition pd // if this is not null, we're calling after analysis
) {
// only address this edge if it is not a special initial edge
if( !edgeCallee.isInitialParam() ) {
- // now we know that in the callee method's ownership graph
+ // now we know that in the callee method's reachability graph
// there is a heap region->heap region reference edge given
// by heap region pointers:
// hrnCallee -> heapChildCallee
//
- // or by the ownership-graph independent ID's:
+ // or by the reachability-graph independent ID's:
// idCallee -> idChildCallee
// make the edge with src and dst so beta info is
boolean labelSelect,
boolean pruneGarbage,
boolean writeReferencers,
- boolean writeParamMappings,
boolean hideSubsetReachability,
boolean hideEdgeTaints
) throws java.io.IOException {