public HashSet<AllocationSite> allocationSites;
+ // CHANGE! Map HRN ID's to token sets (sets of IDs!)
+ public Hashtable< HeapRegionNode, HashSet< HashSet<HeapRegionNode> > > alpha;
+ //public Hashtable< touple< HRN, HRN >, HashSet< HashSet<HeapRegionNode> > > beta;
+
public OwnershipGraph( int allocationDepth ) {
this.allocationDepth = allocationDepth;
paramIndex2id = new Hashtable<Integer, Integer >();
allocationSites = new HashSet <AllocationSite>();
+
+ alpha = new Hashtable< HeapRegionNode, HashSet< HashSet<HeapRegionNode> > >();
}
mergeReferenceEdges ( og );
mergeId2paramIndex ( og );
mergeAllocationSites( og );
+ mergeTokenSets ( og );
}
protected void mergeOwnershipNodes( OwnershipGraph og ) {
}
+
+ protected void mergeTokenSets( OwnershipGraph og ) {
+ // alpha = new Hashtable< HeapRegionNode, HashSet< HashSet<HeapRegionNode> > >();
+
+ // if a key is in one or the other token set,
+ // add it to the merged token set.
+ // if a key is in both graphs, the merged
+ // token set should have that key and the union
+ // of values as the merged value.
+
+ /*
+ Set alphaB = og.alpha.entrySet();
+ Iterator iB = alphaB.iterator();
+ while( iB.hasNext() ) {
+ Map.Entry meB = (Map.Entry) iB.next();
+ HeapRegionNode hrnKeyB = (HeapRegionNode) meB.getKey();
+ HashSet< HashSet<HeapRegionNode> > > tokenSetsB =
+ (HashSet< HashSet<HeapRegionNode> > >) meB.getValue();
+
+ if( !alpha.containsKey( hrnKeyB ) ) {
+ alpha.put( hrnKeyB, tokenSetsB );
+ } else {
+
+ }
+ }
+ */
+ }
+
+
+
+
+
+
// it is necessary in the equals() member functions
// to "check both ways" when comparing the data
// structures of two graphs. For instance, if all
--- /dev/null
+package Analysis.OwnershipAnalysis;
+
+import IR.*;
+import IR.Flat.*;
+import java.util.*;
+import java.io.*;
+
+
+public class ReachabilitySet {
+
+ public HashSet<TokenTupleSet> possibleReachabilities;
+
+
+
+}
\ No newline at end of file
--- /dev/null
+package Analysis.OwnershipAnalysis;
+
+import IR.*;
+import IR.Flat.*;
+import java.util.*;
+import java.io.*;
+
+
+// a token touple is a pair that indicates a
+// heap region node and an arity
+public class TokenTuple
+{
+ private Integer token;
+ private boolean isNewSummary;
+
+ // only summary tokens should have ARITY_MANY?
+ public static final int ARITY_ONE = 1;
+ public static final int ARITY_MANY = 2;
+ private int arity;
+
+ public TokenTuple( HeapRegionNode hrn ) {
+ token = hrn.getID();
+ isNewSummary = hrn.isNewSummary();
+ arity = ARITY_ONE;
+ }
+
+ public TokenTuple( Integer token,
+ boolean isNewSummary,
+ int arity ) {
+ this.token = token;
+ this.isNewSummary = isNewSummary;
+ this.arity = arity;
+ }
+
+ public Integer getToken() { return token; }
+ public int getArity() { return arity; }
+
+ public void increaseArity() {
+ if( isNewSummary ) {
+ arity = ARITY_MANY;
+ }
+ }
+
+ public boolean equals( TokenTuple tt ) {
+ return token.equals( tt.getToken() ) &&
+ arity == tt.getArity();
+ }
+
+ public TokenTuple copy() {
+ return new TokenTuple( token,
+ isNewSummary,
+ arity );
+ }
+}
--- /dev/null
+package Analysis.OwnershipAnalysis;
+
+import IR.*;
+import IR.Flat.*;
+import java.util.*;
+import java.io.*;
+
+
+public class TokenTupleSet {
+
+ public HashSet<TokenTuple> tokenTuples;
+
+ public TokenTupleSet() {
+ tokenTuples = new HashSet<TokenTuple>();
+ }
+
+ public TokenTupleSet( TokenTuple tt ) {
+ this();
+ tokenTuples.add( tt );
+ }
+
+ public TokenTupleSet( TokenTupleSet tts ) {
+ tokenTuples = (HashSet<TokenTuple>) tts.tokenTuples.clone(); //COPY?!
+ }
+
+ public TokenTupleSet union( TokenTupleSet ttsIn ) {
+ TokenTupleSet ttsOut = new TokenTupleSet( this );
+ ttsOut.tokenTuples.addAll( ttsIn.tokenTuples );
+ return ttsOut;
+ }
+}
Analysis/OwnershipAnalysis/HeapRegionNode.class \
Analysis/OwnershipAnalysis/ReferenceEdgeProperties.class \
Analysis/OwnershipAnalysis/AllocationSite.class \
+Analysis/OwnershipAnalysis/TokenTuple.class \
+Analysis/OwnershipAnalysis/TokenTupleSet.class \
+Analysis/OwnershipAnalysis/ReachabilitySet.class \
Util/GraphNode.class Util/Namer.class Util/Relation.class \
Interface/HTTPHeader.class Interface/HTTPResponse.class \
Interface/HTTPServices.class Interface/HashStrings.class \