From: jjenista Date: Fri, 21 Oct 2011 21:16:41 +0000 (+0000) Subject: hacks X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5d49221b6c0a89e4e43c08726e6e3a25aafdaff2;p=IRC.git hacks --- diff --git a/Robust/src/Analysis/Disjoint/DefiniteReachState.java b/Robust/src/Analysis/Disjoint/DefiniteReachState.java index 43a20d27..699ea9ae 100644 --- a/Robust/src/Analysis/Disjoint/DefiniteReachState.java +++ b/Robust/src/Analysis/Disjoint/DefiniteReachState.java @@ -49,9 +49,6 @@ public class DefiniteReachState { - // for MultiViewMaps that don't need to use the value, - // always map to this dummy - private static Object dummy = new Integer( -12345 ); // call before instantiating this class @@ -84,15 +81,14 @@ public class DefiniteReachState { public DefiniteReachState() { + R = RBuilder.build(); //Rs = new HashMap(); //Fu = FuBuilder.build(); } - - public void methodEntry(Set parameters) { - // R' := {} - // R.clear(); + public void methodEntry( Set parameters ) { + methodEntryR( parameters ); //Rs.clear(); //for( TempDescriptor p : parameters ) { @@ -102,18 +98,9 @@ public class DefiniteReachState { //Fu = FuBuilder.build(); } - public void copy(TempDescriptor x, - TempDescriptor y) { - // R' := (R - - <*,x>) U - // {->e | ->e in R} U - // {->e | ->e in R} - // R' = new Map(R) - // R'.remove(view0, x); - // R'.remove(view1, x); - // setYs = R.get(view0, y); - // for each ->e: R'.put(, e); - // setYs = R.get(view1, y); - // for each ->e: R'.put(, e); + public void copy( TempDescriptor x, + TempDescriptor y ) { + copyR( x, y ); // Rs' := (Rs - ) U { | in Rs} //DefReachKnown valRs = Rs.get( y ); @@ -144,9 +131,70 @@ public class DefiniteReachState { //} } - public void load(TempDescriptor x, - TempDescriptor y, - FieldDescriptor f) { + public void load( TempDescriptor x, + TempDescriptor y, + FieldDescriptor f ) { + loadR( x, y, f ); + // Rs' := (Rs - ) U {} + //Rs.put( x, DefReachKnown.UNKNOWN ); + } + + public void store( TempDescriptor x, + FieldDescriptor f, + TempDescriptor y, + Set edgeKeysRemoved ) { + storeR( x, f, y, edgeKeysRemoved ); + // Rs' := Rs + } + + public void newObject( TempDescriptor x ) { + newObjectR( x ); + + // Rs' := (Rs - ) U {} + //Rs.put( x, DefReachKnown.KNOWN ); + + } + + public void methodCall( TempDescriptor retVal ) { + methodCallR( retVal ); + + // Rs' := (Rs - ) U {} + //Rs.put( x, DefReachKnown.UNKNOWN ); + } + + public void merge( DefiniteReachState that ) { + mergeR( that ); + + // Rs' := iff in all incoming edges, otherwie + //mergeRs( that ); + } + + + + + + + public void methodEntryR( Set parameters ) { + R.clear(); + } + + public void copyR( TempDescriptor x, + TempDescriptor y ) { + // R' := (R - - <*,x>) U + // {->e | ->e in R} U + // {->e | ->e in R} + // R' = new Map(R) + // R'.remove(view0, x); + // R'.remove(view1, x); + // setYs = R.get(view0, y); + // for each ->e: R'.put(, e); + // setYs = R.get(view1, y); + // for each ->e: R'.put(, e); + } + + public void loadR( TempDescriptor x, + TempDescriptor y, + FieldDescriptor f ) { // R' := (R - - <*,x>) U // ({} x Eo(y,f)) U // U {} x (Eo(y,f)U{e}) @@ -157,55 +205,41 @@ public class DefiniteReachState { // R'.put(, eee!); // setYs = R.get(view0, y); // for each ->e: R'.put(, eee!Ue); - - // Rs' := (Rs - ) U {} - //Rs.put( x, DefReachKnown.UNKNOWN ); } - public void store(TempDescriptor x, - FieldDescriptor f, - TempDescriptor y, - Set edgeKeysRemoved) { + public void storeR( TempDescriptor x, + FieldDescriptor f, + TempDescriptor y, + Set edgeKeysRemoved ) { // I think this should be if there is ANY ->e' IN Eremove, then kill all // R' := (R - {->e | ->e in R, A->e' in R, e' notin Eremove}) U // {->e | e in E(x) x {f} x E(y)} // R' = new Map(R) // R'.remove(?); some e's... // R'.put(, E(x) x {f} x E(y)); - - // Rs' := Rs } - - public void newObject(TempDescriptor x) { + + public void newObjectR( TempDescriptor x ) { // R' := (R - - <*,x>) // R' = new Map(R) // R'.remove(view0, x); // R'.remove(view1, x); - - // Rs' := (Rs - ) U {} - //Rs.put( x, DefReachKnown.KNOWN ); - } - // x is the return value, x = foo(...); - public void methodCall(TempDescriptor x) { + public void methodCallR( TempDescriptor retVal ) { // R' := (R - - <*,x>) // R' = new Map(R) // R'.remove(view0, x); // R'.remove(view1, x); - - // Rs' := (Rs - ) U {} - //Rs.put( x, DefReachKnown.UNKNOWN ); } - public void merge( DefiniteReachState that ) { + public void mergeR( DefiniteReachState that ) { // R' := ->e iff its in all incoming edges - - // Rs' := iff in all incoming edges, otherwie - //mergeRs( that ); } + + /////////////////////////////////////////////////////////// // // This is WRONG