analyzeMethods();
}
+ // called from the constructor to help initialize the set
+ // of methods that needs to be analyzed by ownership analysis
private void scheduleAllCallees( HashSet<Descriptor> calleesScheduled,
Descriptor d ) {
if( calleesScheduled.contains( d ) ) {
if( !og.equals( ogPrev ) ) {
mapDescriptorToCompleteOwnershipGraph.put( d, og );
+ og.writeGraph( d );
+
// only methods have dependents, tasks cannot
// be invoked by any user program calls
if( d instanceof MethodDescriptor ) {
// apply the analysis of the flat node to the
// ownership graph made from the merge of the
// parent graphs
- analyzeFlatNode( mDesc, fn, og );
+ analyzeFlatNode( mDesc,
+ fn,
+ returnNodesToCombineForCompleteOwnershipGraph,
+ og );
// if the results of the new graph are different from
// the current graph at this node, replace the graph
private void
- analyzeFlatNode( Descriptor methodDesc,
- FlatNode fn,
- OwnershipGraph og ) throws java.io.IOException {
+ analyzeFlatNode( Descriptor methodDesc,
+ FlatNode fn,
+ HashSet<FlatReturnNode> setRetNodes,
+ OwnershipGraph og ) throws java.io.IOException {
TempDescriptor src;
TempDescriptor dst;
TempDescriptor tdParam = fm.getParameter( i );
og.assignTempToParameterAllocation( methodDesc instanceof TaskDescriptor,
tdParam );
- og.writeGraph( methodDesc, fn );
+ //og.writeGraph( methodDesc, fn );
}
break;
src = fon.getLeft();
dst = fon.getDest();
og.assignTempToTemp( src, dst );
- og.writeGraph( methodDesc, fn );
+ //og.writeGraph( methodDesc, fn );
}
break;
fld = ffn.getField();
if( !fld.getType().isPrimitive() ) {
og.assignTempToField( src, dst, fld );
- og.writeGraph( methodDesc, fn );
+ //og.writeGraph( methodDesc, fn );
}
break;
dst = fsfn.getDst();
fld = fsfn.getField();
og.assignFieldToTemp( src, dst, fld );
- og.writeGraph( methodDesc, fn );
+ //og.writeGraph( methodDesc, fn );
break;
case FKind.FlatNew:
//MethodDescriptor md = fc.getMethod();
//descriptorsToVisit.add( md );
//System.out.println( " Descs to visit: " + descriptorsToVisit );
- og.writeGraph( methodDesc, fn );
+ //og.writeGraph( methodDesc, fn );
break;
case FKind.FlatReturnNode:
- og.writeGraph( methodDesc, fn );
+ FlatReturnNode frn = (FlatReturnNode) fn;
+ setRetNodes.add( frn );
+ //og.writeGraph( methodDesc, fn );
break;
}
}
}
+ /*
+ // use this method to determine if two temp descriptors can possibly
+ // access the same heap regions, which means there is a possible alias
+ public boolean havePossibleAlias( TempDescriptor td1,
+ TempDescriptor td2 ) {
+
+
+ return false;
+ }
+ */
+
+
// for writing ownership graphs to dot files
public void writeGraph( Descriptor methodDesc,
FlatNode fn ) throws java.io.IOException {
-
- String graphName =
- methodDesc.getSymbol() +
- methodDesc.getNum() +
- fn.toString();
+ writeGraph(
+ methodDesc.getSymbol() +
+ methodDesc.getNum() +
+ fn.toString()
+ );
+ }
+
+ public void writeGraph( Descriptor methodDesc ) throws java.io.IOException {
+ writeGraph(
+ methodDesc.getSymbol() +
+ methodDesc.getNum() +
+ "COMPLETE"
+ );
+ }
+ private void writeGraph( String graphName ) throws java.io.IOException {
// remove all non-word characters from the graph name so
// the filename and identifier in dot don't cause errors
graphName = graphName.replaceAll( "[\\W]", "" );