// this analysis generates an ownership graph for every task
// in the program
public OwnershipAnalysis(State state,
- TypeUtil tu,
+ TypeUtil tu,
CallGraph callGraph,
int allocationDepth,
boolean writeFinalGraphs,
// ownership graph made from the merge of the
// parent graphs
og = analyzeFlatNode(mDesc,
- fn,
- returnNodesToCombineForCompleteOwnershipGraph,
- og);
+ fn,
+ returnNodesToCombineForCompleteOwnershipGraph,
+ og);
// if the results of the new graph are different from
// the current graph at this node, replace the graph
Iterator srcItr = possibleCallerSrcs.iterator();
while( srcItr.hasNext() ) {
HeapRegionNode src = (HeapRegionNode) srcItr.next();
-
- if( !hasMatchingField( src, edgeCallee ) ) {
+
+ if( !hasMatchingField(src, edgeCallee) ) {
// prune this source node possibility
continue;
}
while( dstItr.hasNext() ) {
HeapRegionNode dst = (HeapRegionNode) dstItr.next();
- if( !hasMatchingType( edgeCallee, dst ) ) {
+ if( !hasMatchingType(edgeCallee, dst) ) {
// prune
continue;
}
while( itrHrn.hasNext() ) {
HeapRegionNode hrnCaller = itrHrn.next();
- if( !hasMatchingType( edgeCallee, hrnCaller ) ) {
+ if( !hasMatchingType(edgeCallee, hrnCaller) ) {
// prune
continue;
}
}
- protected boolean hasMatchingField( HeapRegionNode src, ReferenceEdge edge ) {
-
+ protected boolean hasMatchingField(HeapRegionNode src, ReferenceEdge edge) {
+
// if no allocation site, then it's a match-everything region
AllocationSite asSrc = src.getAllocationSite();
- if( asSrc == null ) { return true; }
-
+ if( asSrc == null ) {
+ return true;
+ }
+
TypeDescriptor tdSrc = asSrc.getType();
assert tdSrc != null;
// if it's not a class, it doesn't have any fields to match
- if( !tdSrc.isClass() ) { return false; }
+ if( !tdSrc.isClass() ) {
+ return false;
+ }
Iterator fieldsSrcItr = tdSrc.getClassDesc().getFields();
while( fieldsSrcItr.hasNext() ) {
}
- protected boolean hasMatchingType( ReferenceEdge edge, HeapRegionNode dst ) {
+ protected boolean hasMatchingType(ReferenceEdge edge, HeapRegionNode dst) {
// if the region has no type, matches everything
AllocationSite asDst = dst.getAllocationSite();
- if( asDst == null ) { return true; }
+ if( asDst == null ) {
+ return true;
+ }
TypeDescriptor tdDst = asDst.getType();
assert tdDst != null;
// if the type is not a class don't match because
// primitives are copied, no memory aliases
ClassDescriptor cdDst = tdDst.getClassDesc();
- if( cdDst == null ) { return false; }
+ if( cdDst == null ) {
+ return false;
+ }
// if the field is null, it matches everything
FieldDescriptor fd = edge.getFieldDesc();
- if( fd == null ) { return true; }
+ if( fd == null ) {
+ return true;
+ }
TypeDescriptor tdFd = fd.getType();
assert tdFd != null;
- return typeUtil.isSuperorType( tdFd, tdDst );
+ return typeUtil.isSuperorType(tdFd, tdDst);
}