projects
/
IRC.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5f08ace
)
fix silly off-by-one bug
author
jjenista
<jjenista>
Tue, 8 Nov 2011 22:14:12 +0000
(22:14 +0000)
committer
jjenista
<jjenista>
Tue, 8 Nov 2011 22:14:12 +0000
(22:14 +0000)
Robust/src/Analysis/Disjoint/DefiniteReachAnalysis.java
patch
|
blob
|
history
Robust/src/Analysis/Disjoint/DefiniteReachState.java
patch
|
blob
|
history
Robust/src/Analysis/Disjoint/DisjointAnalysis.java
patch
|
blob
|
history
Robust/src/Analysis/Disjoint/ReachGraph.java
patch
|
blob
|
history
Robust/src/Tests/disjoint/definite/test.java
patch
|
blob
|
history
diff --git
a/Robust/src/Analysis/Disjoint/DefiniteReachAnalysis.java
b/Robust/src/Analysis/Disjoint/DefiniteReachAnalysis.java
index 2c57170ebcff782196ac5745ccf761a5db5c3f8a..00aa4d939bbbab2a2d3fcdccbbe3dc62b5cbc3c2 100644
(file)
--- a/
Robust/src/Analysis/Disjoint/DefiniteReachAnalysis.java
+++ b/
Robust/src/Analysis/Disjoint/DefiniteReachAnalysis.java
@@
-41,9
+41,9
@@
public class DefiniteReachAnalysis {
TempDescriptor y,
FieldDescriptor f,
Set<EdgeKey> edgeKeysForLoad ) {
TempDescriptor y,
FieldDescriptor f,
Set<EdgeKey> edgeKeysForLoad ) {
+
DefiniteReachState state = makeIn( fn );
state.load( x, y, f, edgeKeysForLoad );
DefiniteReachState state = makeIn( fn );
state.load( x, y, f, edgeKeysForLoad );
- state.writeState( "YO" );
fn2state.put( fn, state );
}
fn2state.put( fn, state );
}
@@
-53,6
+53,7
@@
public class DefiniteReachAnalysis {
TempDescriptor y,
Set<EdgeKey> edgeKeysRemoved,
Set<EdgeKey> edgeKeysAdded ) {
TempDescriptor y,
Set<EdgeKey> edgeKeysRemoved,
Set<EdgeKey> edgeKeysAdded ) {
+
DefiniteReachState state = makeIn( fn );
state.store( x, f, y, edgeKeysRemoved, edgeKeysAdded );
fn2state.put( fn, state );
DefiniteReachState state = makeIn( fn );
state.store( x, f, y, edgeKeysRemoved, edgeKeysAdded );
fn2state.put( fn, state );
@@
-86,7
+87,7
@@
public class DefiniteReachAnalysis {
// get the current state for just after the given
// program point
// get the current state for just after the given
// program point
- p
rivate
DefiniteReachState get( FlatNode fn ) {
+ p
ublic
DefiniteReachState get( FlatNode fn ) {
DefiniteReachState state = fn2state.get( fn );
if( state == null ) {
state = new DefiniteReachState();
DefiniteReachState state = fn2state.get( fn );
if( state == null ) {
state = new DefiniteReachState();
@@
-98,8
+99,8
@@
public class DefiniteReachAnalysis {
// get the current state for the program point just
// before the given program point by merging the out
// states of the predecessor statements
// get the current state for the program point just
// before the given program point by merging the out
// states of the predecessor statements
- p
rivate
DefiniteReachState makeIn( FlatNode fn ) {
- if( fn.numPrev()
<= 1
) {
+ p
ublic
DefiniteReachState makeIn( FlatNode fn ) {
+ if( fn.numPrev()
== 0
) {
return new DefiniteReachState();
}
return new DefiniteReachState();
}
@@
-109,6
+110,7
@@
public class DefiniteReachAnalysis {
for( int i = 1; i < fn.numPrev(); ++i ) {
stateIn.merge( get( fn.getPrev( i ) ) );
}
for( int i = 1; i < fn.numPrev(); ++i ) {
stateIn.merge( get( fn.getPrev( i ) ) );
}
+
return stateIn;
}
}
return stateIn;
}
}
diff --git
a/Robust/src/Analysis/Disjoint/DefiniteReachState.java
b/Robust/src/Analysis/Disjoint/DefiniteReachState.java
index 67f545ce9973fd4cdb3acf7aefaa48559de5aafe..70711b19e7bb0251562896df46836d35e13eb6bb 100644
(file)
--- a/
Robust/src/Analysis/Disjoint/DefiniteReachState.java
+++ b/
Robust/src/Analysis/Disjoint/DefiniteReachState.java
@@
-356,7
+356,6
@@
public class DefiniteReachState {
}
}
-
public String toString() {
StringBuilder s = new StringBuilder();
public String toString() {
StringBuilder s = new StringBuilder();
diff --git
a/Robust/src/Analysis/Disjoint/DisjointAnalysis.java
b/Robust/src/Analysis/Disjoint/DisjointAnalysis.java
index 37ea420590b6ced2845a2afcc3a1876f29aea3e4..c5d03684280c9e3a6aa926e132a6ea1a43114b46 100644
(file)
--- a/
Robust/src/Analysis/Disjoint/DisjointAnalysis.java
+++ b/
Robust/src/Analysis/Disjoint/DisjointAnalysis.java
@@
-1312,13
+1312,11
@@
public class DisjointAnalysis implements HeapAnalysis {
fn2rgAtEnter.put(fn, rgOnEnter);
fn2rgAtEnter.put(fn, rgOnEnter);
-
boolean didDefReachTransfer = false;
boolean didDefReachTransfer = false;
-
// use node type to decide what transfer function
// to apply to the reachability graph
switch( fn.kind() ) {
// use node type to decide what transfer function
// to apply to the reachability graph
switch( fn.kind() ) {
@@
-1953,7
+1951,6
@@
public class DisjointAnalysis implements HeapAnalysis {
-
// 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
// 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
diff --git
a/Robust/src/Analysis/Disjoint/ReachGraph.java
b/Robust/src/Analysis/Disjoint/ReachGraph.java
index d231593bfdbac6bfa5007405bb5e8f641464c697..69bece23aed3a63ce73a863132206d184b6a0e48 100644
(file)
--- a/
Robust/src/Analysis/Disjoint/ReachGraph.java
+++ b/
Robust/src/Analysis/Disjoint/ReachGraph.java
@@
-718,6
+718,7
@@
public class ReachGraph {
continue;
}
continue;
}
+
// for definite reach analysis only
if( edgeKeysAdded != null ) {
assert f != null;
// for definite reach analysis only
if( edgeKeysAdded != null ) {
assert f != null;
@@
-725,6
+726,8
@@
public class ReachGraph {
hrnY.getID(),
f )
);
hrnY.getID(),
f )
);
+
+
}
// prepare the new reference edge hrnX.f -> hrnY
}
// prepare the new reference edge hrnX.f -> hrnY
diff --git
a/Robust/src/Tests/disjoint/definite/test.java
b/Robust/src/Tests/disjoint/definite/test.java
index cb4238bd7237a3da57d05851ddcabff9398672e8..5970eff5189c692518ca1f3639b8f167b81df45e 100644
(file)
--- a/
Robust/src/Tests/disjoint/definite/test.java
+++ b/
Robust/src/Tests/disjoint/definite/test.java
@@
-8,6
+8,22
@@
public class Test {
static public void main( String args[] ) {
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();
gendefreach yn1;
Foo x = getFlagged();
@@
-37,9
+53,9
@@
public class Test {
// of objects y is reachable from.
gendefreach y2;
genreach y2;
// 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() {
}
static public Foo getFlagged() {