site nodes with the object type, numbering heap regions allocated for a parameter
by the parameter index and tested that initial parameter relfexive edges get
clobbered by code that introduces a self-reference.
protected int allocationDepth;
protected Vector<Integer> ithOldest;
protected Integer summary;
+ protected TypeDescriptor type;
- public AllocationSite( int allocationDepth ) {
+ public AllocationSite( int allocationDepth, TypeDescriptor type ) {
assert allocationDepth >= 3;
this.allocationDepth = allocationDepth;
+ this.type = type;
ithOldest = new Vector<Integer>( allocationDepth );
id = generateUniqueAllocationSiteID();
return summary;
}
+ public TypeDescriptor getType() {
+ return type;
+ }
+
public String toString() {
- return "allocSite" + id;
+ return "allocSite" + id + "\\n" + type;
}
}
// return just the allocation site associated with one FlatNew node
private AllocationSite getAllocationSiteFromFlatNew( FlatNew fn ) {
if( !mapFlatNewToAllocationSite.containsKey( fn ) ) {
- AllocationSite as = new AllocationSite( allocationDepth );
+ AllocationSite as = new AllocationSite( allocationDepth, fn.getType() );
// the newest nodes are single objects
for( int i = 0; i < allocationDepth; ++i ) {
false,
isTask,
false,
- "param" );
+ "param" + paramIndex );
// keep track of heap regions that were created for
// parameter labels, the index of the parameter they
if( hrnSummary == null ) {
hrnSummary = createNewHeapRegionNode( idSummary,
false,
- false,
+ as.getType().getClassDesc().hasFlags(),
true,
as + "\\nsummary" );
}
if( hrnK == null ) {
hrnK = createNewHeapRegionNode( idK,
true,
- false,
+ as.getType().getClassDesc().hasFlags(),
false,
as + "\\noldest" );
}
if( hrnI == null ) {
hrnI = createNewHeapRegionNode( idIth,
true,
- false,
+ as.getType().getClassDesc().hasFlags(),
false,
as + "\\n" + Integer.toString( i ) + "th" );
}
if( hrnImin1 == null ) {
hrnImin1 = createNewHeapRegionNode( idImin1th,
true,
- false,
+ as.getType().getClassDesc().hasFlags(),
false,
as + "\\n" + Integer.toString( i-1 ) + "th" );
}
- /*
+
// 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 ) {
+ LabelNode ln1 = getLabelNodeFromTemp( td1 );
+ LabelNode ln2 = getLabelNodeFromTemp( td2 );
+
return false;
}
- */
+
// for writing ownership graphs to dot files
}
// then visit every label node
+ /*
s = td2ln.entrySet();
i = s.iterator();
while( i.hasNext() ) {
"\"];\n" );
}
}
+ */
bw.write( "}\n" );
bw.close();
+++ /dev/null
-Make sure to test that an initial parameter has a special reflexive edge, but if you
-actually remake that edge during the method analysis, it becomes a regular edge and
-then will get picked up by the method call resolution!
-/*
+
public class Parameter {
flag w;
int a, b;
public void bar() { x = 1; }
}
-*/
-/*
public class Voo {
- flag f; int x; Baw b;
+ flag f; int x; Baw b; Baw bb;
public Voo() {}
}
public class Baw {
flag g; int y;
+ Foo f;
public Baw() {}
public void doTheBaw( Voo v ) { v = new Voo(); }
}
-*/
+
public class Foo {
public Foo() {}
// be a heap region for the parameter, and several
// heap regions for the allocation site, but the label
// merely points to the newest region
-/*
+
task NewObject( Voo v{ f } ) {
Voo w = new Voo();
Baw b = new Baw();
}
-task NewInLoop( Voo v{ f } ) {
+task NoAliasNewInLoop( Voo v{ f } ) {
Voo w = new Voo();
for( int i = 0; i < 10; ++i ) {
w.b = new Baw();
+ w.b.f = new Foo();
}
taskexit( v{ !f } );
}
-*/
+
+
+task ClobberInitParamReflex( Voo v{ f }, Voo w{ f } ) {
+ v.b = v.bb;
+
+ taskexit( v{ !f }, w{ !f } );
+}
\ No newline at end of file
taskexit( s{ !initialstate } );
}
-/*
+
task aliasFromObjectAssignment
( Parameter p1{!w}, Parameter p2{!w} ) {
taskexit( p1{w}, p2{w} );
}
-*/
-/*
task bunchOfPaths
( Parameter p1{!w}, Parameter p2{!w} ) {
taskexit( p1{w}, p2{w} );
}
-*/
-/*
task literalTest( Parameter p1{!w} ) {
Parameter x = null;
int y = 5;
taskexit( p1{w}, p2{w} );
}
-*/
\ No newline at end of file