TempDescriptor y,
FieldDescriptor f,
Set<EdgeKey> edgeKeysForLoad ) {
+
DefiniteReachState state = makeIn( fn );
state.load( x, y, f, edgeKeysForLoad );
- state.writeState( "YO" );
fn2state.put( fn, state );
}
TempDescriptor y,
Set<EdgeKey> edgeKeysRemoved,
Set<EdgeKey> edgeKeysAdded ) {
+
DefiniteReachState state = makeIn( fn );
state.store( x, f, y, edgeKeysRemoved, edgeKeysAdded );
fn2state.put( fn, state );
// get the current state for just after the given
// program point
- private DefiniteReachState get( FlatNode fn ) {
+ public DefiniteReachState get( FlatNode fn ) {
DefiniteReachState state = fn2state.get( fn );
if( state == null ) {
state = new DefiniteReachState();
// get the current state for the program point just
// before the given program point by merging the out
// states of the predecessor statements
- private DefiniteReachState makeIn( FlatNode fn ) {
- if( fn.numPrev() <= 1 ) {
+ public DefiniteReachState makeIn( FlatNode fn ) {
+ if( fn.numPrev() == 0 ) {
return new DefiniteReachState();
}
for( int i = 1; i < fn.numPrev(); ++i ) {
stateIn.merge( get( fn.getPrev( i ) ) );
}
+
return stateIn;
}
}
fn2rgAtEnter.put(fn, rgOnEnter);
-
boolean didDefReachTransfer = false;
-
// use node type to decide what transfer function
// to apply to the reachability graph
switch( fn.kind() ) {
-
// dead variables were removed before the above transfer function
// was applied, so eliminate heap regions and edges that are no
// longer part of the abstractly-live heap graph, and sweep up
static public void main( String args[] ) {
+
+ Foo x = getFlagged();
+ Foo y = getUnflagged();
+
+ x.f = y;
+
+ gendefreach QWQ1;
+
+ Foo z = x;
+ while( false ) {
+ z = z.f;
+ }
+
+ gendefreach QWQ2;
+
+ /*
gendefreach yn1;
Foo x = getFlagged();
// of objects y is reachable from.
gendefreach y2;
genreach y2;
+ */
-
- System.out.println( x+","+y );
+ System.out.println( " "+x+y+z );
}
static public Foo getFlagged() {