}
+ /*
public boolean equals( Object o ) {
if( o == null ) {
return false;
public int hashCode() {
return id.intValue();
}
-
+ */
public boolean isSingleObject() {
return td;
}
+ /*
public boolean equals( Object o ) {
if( o == null ) {
return false;
public int hashCode() {
return td.getNum();
}
-
+ */
public String getTempDescriptorString() {
return td.toString();
}
+ int x = 0;
+
+
// keep passing the Descriptor of the method along for debugging
// and dot file writing
private OwnershipGraph
if( !og.equals( ogPrev ) ) {
setGraphForFlatNode( fn, og );
+
+
+ x++;
+ if( x > 0 ) {
+ String s = String.format( "debug%04d", x );
+ //og.writeGraph( s, true, true, true, false );
+ }
+
+
+
for( int i = 0; i < fn.numNext(); i++ ) {
FlatNode nn = fn.getNext( i );
flatNodesToVisit.add( nn );
}
}
+
+
+
+
+ static int x = 0;
+
public void assignFieldToTemp( TempDescriptor src,
TempDescriptor dst,
FieldDescriptor fd ) {
hrnSrc = (HeapRegionNode) meS.getKey();
repSrc = (ReferenceEdgeProperties) meS.getValue();
- ReachabilitySet O = srcln.getReferenceTo( hrnSrc ).getBeta();
+ ReachabilitySet O = repSrc.getBeta();
+
+
+ x++;
+ System.out.println( "x is "+x );
+ if( x > 0 ) {
+ String s = String.format( "debug%04d", x );
+ try {
+ writeGraph( s, true, true, true, false );
+ } catch( Exception e ) {}
+ }
+
+ System.out.println( " O is "+O );
// propagate tokens over nodes starting from hrnSrc, and it will
// take care of propagating back up edges from any touched nodes
Iterator referItr = hrn.iteratorToReferencers();
while( referItr.hasNext() ) {
OwnershipNode onRef = (OwnershipNode) referItr.next();
+
+ System.out.println( " "+onRef+" is upstream" );
+
ReferenceEdgeProperties repUpstream = onRef.getReferenceTo( hrn );
todoEdges.add( repUpstream );
edgePlannedChanges.put( repUpstream, Cx );
}
+ System.out.println( "plans "+edgePlannedChanges );
+
propagateTokensOverEdges( todoEdges,
edgePlannedChanges,
nodesWithNewAlpha,
edgesWithNewBeta );
+ System.out.println( " Onew = "+repSrc.getBetaNew() );
+
// finally, create the actual reference edge hrn->hrnSrc
ReferenceEdgeProperties repNew
= new ReferenceEdgeProperties( fd,
Iterator edgeItr = edgesWithNewBeta.iterator();
while( edgeItr.hasNext() ) {
((ReferenceEdgeProperties) edgeItr.next()).applyBetaNew();
- }
+ }
}
public void assignTempToParameterAllocation( boolean isTask,
FlatMethod fm,
OwnershipGraph ogCallee ) {
+ /*
// verify the existence of allocation sites and their
// shadows from the callee in the context of this caller graph
Iterator<AllocationSite> asItr = ogCallee.allocationSites.iterator();
}
}
}
+ */
}
}
+ /*
abstract public boolean equals( Object o );
abstract public int hashCode();
+ */
}
\ No newline at end of file
return possibleReachabilities.contains( tts );
}
+ public boolean containsTuple( TokenTuple tt ) {
+ Iterator itr = iterator();
+ while( itr.hasNext() ) {
+ TokenTupleSet tts = (TokenTupleSet) itr.next();
+ if( tts.containsTuple( tt ) ) {
+ return true;
+ }
+ }
+ return false;
+ }
+
public ReachabilitySet add( TokenTupleSet tts ) {
ReachabilitySet rsOut = new ReachabilitySet( tts );
return this.union( rsOut );
public class ReferenceEdgeProperties {
+
// a null field descriptor means "any field"
protected FieldDescriptor fieldDesc;
protected OwnershipNode src;
protected HeapRegionNode dst;
+
public ReferenceEdgeProperties() {
this( null, false, null );
}
if( beta != null ) {
this.beta = beta;
} else {
- this.beta = new ReachabilitySet();
- this.beta = this.beta.makeCanonical();
+ this.beta = new ReachabilitySet().makeCanonical();
}
// these members are set by higher-level code
// when edges are not undergoing a transitional operation
// that is changing beta info, betaNew is always empty
- betaNew = new ReachabilitySet();
- betaNew = betaNew.makeCanonical();
+ betaNew = new ReachabilitySet().makeCanonical();
}
}
-
public boolean isInitialParamReflexive() {
return isInitialParamReflexive;
}
public void applyBetaNew() {
assert betaNew != null;
- beta = betaNew;
-
- betaNew = new ReachabilitySet();
- betaNew = betaNew.makeCanonical();
+ beta = betaNew;
+ betaNew = new ReachabilitySet().makeCanonical();
}
+ /*
+
+ WHY ARE THESE METHODS INCORRECT? WHEN INCLUDED, THE ANALYSIS GOES
+ HAYWIRE WITH REGARD TO REFERENCE EDGES
+
public boolean equals( Object o ) {
if( o == null ) {
return false;
public int hashCode() {
int hash = 0;
+
if( fieldDesc != null ) {
hash += fieldDesc.getType().hashCode();
}
+
+ if( isInitialParamReflexive ) {
+ hash += 1;
+ }
+
hash += beta.hashCode();
+
return hash;
}
+ */
public String getBetaString() {
a.x = b.x;
}
+ /*
static public void test( Foo p0, Foo p1 ) {
Foo f0 = new Foo();
Foo f1 = new Foo();
p1.x = f1;
p1.x = f2;
}
+ */
}
b = c;
}
*/
-
- /*
- aa.x = ab;
- ab.x = ac;
- ab.x = aa;
- ad.x = aa;
- */
taskexit( s{ !initialstate } );
}
+task basics( Foo p0{ f } ) {
+
+ //Foo a = new Foo();
+ //Foo b = new Foo();
+
+ Foo a = new Foo();
+ a.x = new Foo();
+ a.x.x = new Foo();
+
+ //p0.x = a;
+ //a.x = b;
+
+ taskexit( p0{ !f } );
+}
+
+
task methodTest( Foo p0{ f } ) {
+ Foo up0 = new Foo();
+ Foo up1 = new Foo();
+ Foo up2 = new Foo();
+
Foo a0;
+ Foo a1;
+
if( false ) {
- a0 = new Foo();
- } else {
- a0 = new Foo();
- a0.x = new Foo();
- p0.x = a0;
+ a0 = new Foo();
+ up0.x = a0;
+ a0.x = new Foo();
+ //Foo temp = new Foo();
}
- Foo a1 = new Foo();
+ if( false ) {
+ a0 = new Foo();
+ a0.x = new Foo();
+ a1 = a0;
+ up1.x = a0;
+ }
- if( false ) {
- p0.x = a1;
+ if( false ) {
+ a1 = new Foo();
+ up2.x = a1;
}
- Foo.test( a0, a1 );
+ // Foo.test( a0, a1 );
taskexit( p0{ !f } );
}
+
+
+
/*
task NewObject( Foo a{ f }, Foo b{ f } ) {