this.callGraph = callGraph;
this.allocationDepth = allocationDepth;
+ // temporary for debugging
+ this.allocationDepth = 1;
+
descriptorsToVisit = new HashSet<Descriptor>();
mapDescriptorToCompleteOwnershipGraph =
boolean pruneGarbage,
boolean writeReferencers
*/
- og.writeGraph( d, true, true, false, false );
+ og.writeGraph( d, true, true, true, false );
// only methods have dependents, tasks cannot
// be invoked by any user program calls
public OwnershipGraph( int allocationDepth ) {
this.allocationDepth = allocationDepth;
-
+
id2hrn = new Hashtable<Integer, HeapRegionNode>();
td2ln = new Hashtable<TempDescriptor, LabelNode >();
id2paramIndex = new Hashtable<Integer, Integer >();
if( alpha == null ) {
if( isFlagged || isParameter ) {
alpha = new ReachabilitySet( new TokenTuple( id,
- isNewSummary,
+ !isSingleObject,
TokenTuple.ARITY_ONE )
).makeCanonical();
} else {
HeapRegionNode hrnY = edgeY.getDst();
ReachabilitySet O = edgeY.getBeta();
+
// propagate tokens over nodes starting from hrnSrc, and it will
// take care of propagating back up edges from any touched nodes
ChangeTupleSet Cy = O.unionUpArityToChangeSet( R );
nodesWithNewAlpha,
edgesWithNewBeta );
- // finally, create the actual reference edge hrnX.f -> hrnY
+
+
+ //System.out.println( edgeY.getBetaNew() + "\nbeing pruned by\n" + hrnX.getAlpha() );
+
+ // create the actual reference edge hrnX.f -> hrnY
ReferenceEdge edgeNew = new ReferenceEdge( hrnX,
hrnY,
f,
false,
edgeY.getBetaNew().pruneBy( hrnX.getAlpha() )
+ //edgeY.getBeta().pruneBy( hrnX.getAlpha() )
);
+ addReferenceEdge( hrnX, hrnY, edgeNew );
+
+ /*
if( f != null ) {
// we can do a strong update here if one of two cases holds
// SAVE FOR LATER, WITHOUT STILL CORRECT
- /*
if( (hrnX.getNumReferencers() == 1) ||
( lnX.getNumReferencees() == 1 && hrnX.isSingleObject() )
) {
clearReferenceEdgesFrom( hrnX, f, false );
- }
- */
+ }
addReferenceEdge( hrnX, hrnY, edgeNew );
addReferenceEdge( hrnX, hrnY, edgeNew );
}
}
+ */
}
}
paramIndex2id.put( paramIndex, newID );
ReachabilitySet beta = new ReachabilitySet( new TokenTuple( newID,
- false,
+ true,
TokenTuple.ARITY_ONE ) );
// heap regions for parameters are always multiple object (see above)
+/*
public class Parameter {
flag w;
int a, b;
public void doTheBaw( Voo v ) { v = new Voo(); }
}
+*/
public class Foo {
flag f;
public Foo x;
public Foo y;
+ /*
public void ruinSomeFoos( Foo a, Foo b ) {
a.x = b.x;
}
p1.x = f1;
p1.x = f2;
}
+ */
}
taskexit( s{ !initialstate } );
}
-
+/*
task NewObjectA( Foo a{ f }, Foo b{ f } ) {
Foo c = new Foo();
taskexit( a{ !f }, b{ !f } );
}
+*/
+/*
task NewObjectC( Foo a{ f }, Foo b{ f } ) {
+ Foo z = new Foo();
+ a.x = z;
+ a.y = z;
+
Foo c;
while( false ) {
taskexit( a{ !f }, b{ !f } );
}
+*/
+
+
+task forMethod( Foo p0{ f } ) {
+
+ Foo a0;
+ Foo a1;
+
+ while( false ) {
+ a1 = a0;
+ if( false ) {
+ a0 = new Foo();
+ }
+ }
+
+ Foo z = new Foo();
+ a1.x = z;
+ z.x = a1;
+
+
+ taskexit( p0{ !f } );
+}
+/*
// this task allocates a new object, so there should
// be a heap region for the parameter, and several
// heap regions for the allocation site, but the label
taskexit( p0{ !f } );
}
+*/