projects
/
IRC.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
4a9f8ad
)
More reachability implementation, no token propagation yet.
author
jjenista
<jjenista>
Tue, 15 Jul 2008 21:42:41 +0000
(21:42 +0000)
committer
jjenista
<jjenista>
Tue, 15 Jul 2008 21:42:41 +0000
(21:42 +0000)
Robust/src/Analysis/OwnershipAnalysis/HeapRegionNode.java
patch
|
blob
|
history
Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java
patch
|
blob
|
history
Robust/src/Analysis/OwnershipAnalysis/ReferenceEdgeProperties.java
patch
|
blob
|
history
Robust/src/Tests/OwnershipAnalysisTest/test01/test01.java
patch
|
blob
|
history
diff --git
a/Robust/src/Analysis/OwnershipAnalysis/HeapRegionNode.java
b/Robust/src/Analysis/OwnershipAnalysis/HeapRegionNode.java
index 08502304f90a84cda4dfaeb2b0a040211b2d340f..6650e669c343b4c0a0c2206dedc10d45484008a3 100644
(file)
--- a/
Robust/src/Analysis/OwnershipAnalysis/HeapRegionNode.java
+++ b/
Robust/src/Analysis/OwnershipAnalysis/HeapRegionNode.java
@@
-18,6
+18,7
@@
public class HeapRegionNode extends OwnershipNode {
protected AllocationSite allocSite;
protected ReachabilitySet alpha;
protected AllocationSite allocSite;
protected ReachabilitySet alpha;
+ protected ReachabilitySet alphaNew;
protected String description;
protected String description;
@@
-36,6
+37,7
@@
public class HeapRegionNode extends OwnershipNode {
this.isNewSummary = isNewSummary;
this.allocSite = allocSite;
this.alpha = alpha;
this.isNewSummary = isNewSummary;
this.allocSite = allocSite;
this.alpha = alpha;
+ this.alphaNew = null;
this.description = description;
referencers = new HashSet<OwnershipNode>();
this.description = description;
referencers = new HashSet<OwnershipNode>();
@@
-126,6
+128,20
@@
public class HeapRegionNode extends OwnershipNode {
return alpha;
}
return alpha;
}
+ public ReachabilitySet getAlphaNew() {
+ return alphaNew;
+ }
+
+ public void setAlphaNew( ReachabilitySet alpha ) {
+ this.alphaNew = alpha;
+ }
+
+ public void applyAlphaNew() {
+ assert alphaNew != null;
+ alpha = alphaNew;
+ alphaNew = null;
+ }
+
public String getIDString() {
return id.toString();
public String getIDString() {
return id.toString();
diff --git
a/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java
b/Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java
index afab559d67a4f8d26ef59a36d9dfb31ec3565fd4..cee91235777ddb6224dfbd490e1242106db11529 100644
(file)
--- a/
Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java
+++ b/
Robust/src/Analysis/OwnershipAnalysis/OwnershipGraph.java
@@
-156,6
+156,12
@@
public class OwnershipGraph {
}
}
+
+ protected void propagateTokens( HeapRegionNode nPrime, ChangeTupleSet c0 ) {
+
+ }
+
+
////////////////////////////////////////////////////
//
// Assignment Operation Methods
////////////////////////////////////////////////////
//
// Assignment Operation Methods
@@
-215,6
+221,7
@@
public class OwnershipGraph {
ReachabilitySet beta2 = rep2.getBeta();
ReferenceEdgeProperties rep = rep2.copy();
ReachabilitySet beta2 = rep2.getBeta();
ReferenceEdgeProperties rep = rep2.copy();
+ rep.setIsInitialParamReflexive( false );
rep.setBeta( beta1.intersection( beta2 ) );
addReferenceEdge( dstln, hrnOneHop, rep );
rep.setBeta( beta1.intersection( beta2 ) );
addReferenceEdge( dstln, hrnOneHop, rep );
@@
-225,25
+232,54
@@
public class OwnershipGraph {
public void assignFieldToTemp( TempDescriptor src,
TempDescriptor dst,
FieldDescriptor fd ) {
public void assignFieldToTemp( TempDescriptor src,
TempDescriptor dst,
FieldDescriptor fd ) {
+
+ // I think my use of src and dst are actually backwards in this method!
+ // acccording to the Reachability Notes, think of dst at N and src as N prime
+
LabelNode srcln = getLabelNodeFromTemp( src );
LabelNode dstln = getLabelNodeFromTemp( dst );
LabelNode srcln = getLabelNodeFromTemp( src );
LabelNode dstln = getLabelNodeFromTemp( dst );
- HeapRegionNode hrn = null;
+ HashSet<HeapRegionNode> nodesWithNewAlpha = new HashSet<HeapRegionNode>();
+ HashSet<ReferenceEdgeProperties> edgesWithNewBeta = new HashSet<ReferenceEdgeProperties>();
+
+ HeapRegionNode hrn = null;
+ ReferenceEdgeProperties rep = null;
Iterator dstRegionsItr = dstln.setIteratorToReferencedRegions();
while( dstRegionsItr.hasNext() ) {
Iterator dstRegionsItr = dstln.setIteratorToReferencedRegions();
while( dstRegionsItr.hasNext() ) {
- Map.Entry me = (Map.Entry) dstRegionsItr.next();
- hrn = (HeapRegionNode) me.getKey();
+ Map.Entry me = (Map.Entry) dstRegionsItr.next();
+ hrn = (HeapRegionNode) me.getKey();
+ rep = (ReferenceEdgeProperties) me.getValue();
- HeapRegionNode hrnSrc = null;
+ ReachabilitySet R = hrn.getAlpha().intersection( rep.getBeta() );
+
+ HeapRegionNode hrnSrc = null;
+ ReferenceEdgeProperties repSrc = null;
Iterator srcRegionsItr = srcln.setIteratorToReferencedRegions();
while( srcRegionsItr.hasNext() ) {
Iterator srcRegionsItr = srcln.setIteratorToReferencedRegions();
while( srcRegionsItr.hasNext() ) {
- Map.Entry meS = (Map.Entry) srcRegionsItr.next();
- hrnSrc = (HeapRegionNode) meS.getKey();
+ Map.Entry meS = (Map.Entry) srcRegionsItr.next();
+ hrnSrc = (HeapRegionNode) meS.getKey();
+ repSrc = (ReferenceEdgeProperties) meS.getValue();
+
+ ReferenceEdgeProperties repNew
+ = new ReferenceEdgeProperties( false, false, null );
- ReferenceEdgeProperties rep = new ReferenceEdgeProperties();
- addReferenceEdge( hrn, hrnSrc, rep );
+ addReferenceEdge( hrn, hrnSrc, repNew );
+
+ ReachabilitySet O = srcln.getReferenceTo( hrnSrc ).getBeta();
+ ChangeTupleSet C = O.unionUpArity( R );
+ propagateTokens( hrnSrc, C );
}
}
}
}
+
+ Iterator nodeItr = nodesWithNewAlpha.iterator();
+ while( nodeItr.hasNext() ) {
+ ((HeapRegionNode) nodeItr.next()).applyAlphaNew();
+ }
+
+ Iterator edgeItr = edgesWithNewBeta.iterator();
+ while( edgeItr.hasNext() ) {
+ ((ReferenceEdgeProperties) edgeItr.next()).applyBetaNew();
+ }
}
public void assignTempToParameterAllocation( boolean isTask,
}
public void assignTempToParameterAllocation( boolean isTask,
diff --git
a/Robust/src/Analysis/OwnershipAnalysis/ReferenceEdgeProperties.java
b/Robust/src/Analysis/OwnershipAnalysis/ReferenceEdgeProperties.java
index c0a90736520b8c7593625b87c1671365d2201624..3226d681a0ff5b28b4e5b11ed2fc5b4c38bab22f 100644
(file)
--- a/
Robust/src/Analysis/OwnershipAnalysis/ReferenceEdgeProperties.java
+++ b/
Robust/src/Analysis/OwnershipAnalysis/ReferenceEdgeProperties.java
@@
-2,16
+2,25
@@
package Analysis.OwnershipAnalysis;
public class ReferenceEdgeProperties {
public class ReferenceEdgeProperties {
+ protected boolean isUnique;
+ protected boolean isInitialParamReflexive;
+
+ protected ReachabilitySet beta;
+ protected ReachabilitySet betaNew;
+
+
public ReferenceEdgeProperties() {
this.isUnique = false;
this.isInitialParamReflexive = false;
this.beta = new ReachabilitySet();
public ReferenceEdgeProperties() {
this.isUnique = false;
this.isInitialParamReflexive = false;
this.beta = new ReachabilitySet();
+ this.betaNew = null;
}
public ReferenceEdgeProperties( boolean isUnique ) {
this.isUnique = isUnique;
this.isInitialParamReflexive = false;
this.beta = new ReachabilitySet();
}
public ReferenceEdgeProperties( boolean isUnique ) {
this.isUnique = isUnique;
this.isInitialParamReflexive = false;
this.beta = new ReachabilitySet();
+ this.betaNew = null;
}
public ReferenceEdgeProperties( boolean isUnique,
}
public ReferenceEdgeProperties( boolean isUnique,
@@
-19,6
+28,7
@@
public class ReferenceEdgeProperties {
this.isUnique = isUnique;
this.isInitialParamReflexive = isInitialParamReflexive;
this.beta = new ReachabilitySet();
this.isUnique = isUnique;
this.isInitialParamReflexive = isInitialParamReflexive;
this.beta = new ReachabilitySet();
+ this.betaNew = null;
}
public ReferenceEdgeProperties( boolean isUnique,
}
public ReferenceEdgeProperties( boolean isUnique,
@@
-27,6
+37,7
@@
public class ReferenceEdgeProperties {
this.isUnique = isUnique;
this.isInitialParamReflexive = isInitialParamReflexive;
this.beta = beta;
this.isUnique = isUnique;
this.isInitialParamReflexive = isInitialParamReflexive;
this.beta = beta;
+ this.betaNew = null;
}
}
@@
-37,7
+48,7
@@
public class ReferenceEdgeProperties {
}
}
- protected boolean isUnique;
+
public boolean isUnique() {
return isUnique;
}
public boolean isUnique() {
return isUnique;
}
@@
-46,7
+57,7
@@
public class ReferenceEdgeProperties {
}
}
- protected boolean isInitialParamReflexive;
+
public boolean isInitialParamReflexive() {
return isInitialParamReflexive;
}
public boolean isInitialParamReflexive() {
return isInitialParamReflexive;
}
@@
-55,7
+66,7
@@
public class ReferenceEdgeProperties {
}
}
- protected ReachabilitySet beta;
+
public ReachabilitySet getBeta() {
return beta;
}
public ReachabilitySet getBeta() {
return beta;
}
@@
-63,6
+74,19
@@
public class ReferenceEdgeProperties {
this.beta = beta;
}
this.beta = beta;
}
+ public ReachabilitySet getBetaNew() {
+ return betaNew;
+ }
+ public void setBetaNew( ReachabilitySet beta ) {
+ this.betaNew = beta;
+ }
+ public void applyBetaNew() {
+ assert betaNew != null;
+ beta = betaNew;
+ betaNew = null;
+ }
+
+
public boolean equals( ReferenceEdgeProperties rep ) {
return isUnique == rep.isUnique() &&
isInitialParamReflexive == rep.isInitialParamReflexive();
public boolean equals( ReferenceEdgeProperties rep ) {
return isUnique == rep.isUnique() &&
isInitialParamReflexive == rep.isInitialParamReflexive();
@@
-80,7
+104,7
@@
public class ReferenceEdgeProperties {
}
*/
if( isInitialParamReflexive ) {
}
*/
if( isInitialParamReflexive ) {
- edgeLabel += "Rfx\\n";
+ edgeLabel += "Rf
l
x\\n";
}
edgeLabel += getBetaString();
return edgeLabel;
}
edgeLabel += getBetaString();
return edgeLabel;
diff --git
a/Robust/src/Tests/OwnershipAnalysisTest/test01/test01.java
b/Robust/src/Tests/OwnershipAnalysisTest/test01/test01.java
index fff7a976c65d87d13bc94f19caf8ba781a17d605..7c3e770fe8a829b7420610a4e7ab8473ea97cc57 100644
(file)
--- a/
Robust/src/Tests/OwnershipAnalysisTest/test01/test01.java
+++ b/
Robust/src/Tests/OwnershipAnalysisTest/test01/test01.java
@@
-36,6
+36,8
@@
public class Baw {
public class Foo {
public class Foo {
+ flag f;
+
public Foo() {}
public Foo x;
public Foo() {}
public Foo x;
@@
-62,6
+64,18
@@
task Startup( StartupObject s{ initialstate } ) {
}
}
+task NewObject( Foo a{ f }, Foo b{ f } ) {
+
+ Foo c = new Foo();
+
+ a.x = c;
+
+ taskexit( a{ !f }, b{ !f } );
+}
+
+
+
+/*
// this task allocates a new object, so there should
// be a heap region for the parameter, and several
// heap regions for the allocation site, but the label
// this task allocates a new object, so there should
// be a heap region for the parameter, and several
// heap regions for the allocation site, but the label
@@
-123,3
+137,4
@@
task ClobberInitParamReflex( Voo v{ f }, Voo w{ f } ) {
taskexit( v{ !f }, w{ !f } );
}
taskexit( v{ !f }, w{ !f } );
}
+*/
\ No newline at end of file