}
}
+ /* This function builds the last delta for a basic block. It
+ * handles the case for the first time the basic block is
+ * evaluated.*/
+
void buildInitDelta(Graph graph, Delta newDelta) {
//First compute the set of temps
HashSet<TempDescriptor> tmpSet=new HashSet<TempDescriptor>();
}
}
+ /* This function build the delta for the exit of a basic block. */
+
void generateFinalDelta(BBlock bblock, Delta delta, Graph graph) {
Delta newDelta=new Delta(null, false);
if (delta.getInit()) {
}
}
+ /* This function compute the edges for the this variable for a
+ * callee if it exists. */
+
void processThisTargets(HashSet<ClassDescriptor> targetSet, Graph graph, Delta delta, Delta newDelta, HashSet<AllocNode> nodeset, Stack<AllocNode> tovisit, MySet<Edge> edgeset, TempDescriptor tmpthis, HashSet<AllocNode> oldnodeset) {
//Handle the this temp
if (tmpthis!=null) {
}
}
+ /* This function compute the edges for a call's parameters. */
+
void processParams(Graph graph, Delta delta, Delta newDelta, HashSet<AllocNode> nodeset, Stack<AllocNode> tovisit, MySet<Edge> edgeset, FlatCall fcall, boolean diff) {
//Go through each temp
for(int i=0;i<fcall.numArgs();i++) {
}
}
+ /* This function computes the reachable nodes for a callee. */
+
void computeReachableNodes(Graph graph, Delta delta, Delta newDelta, HashSet<AllocNode> nodeset, Stack<AllocNode> tovisit, MySet<Edge> edgeset, HashSet<AllocNode> oldnodeset) {
while(!tovisit.isEmpty()) {
AllocNode node=tovisit.pop();
}
}
}
+
+ /* This function removes the caller reachable edges from the
+ * callee's heap. */
void removeEdges(Delta delta, HashSet<AllocNode> nodeset, MySet<Edge> edgeset, MySet<Edge> externaledgeset) {
//Want to remove the set of internal edges
return delta;
}
-
+ /* This function applies callee deltas to the caller heap. */
Delta applyCallDelta(Delta delta, BBlock bblock) {
Delta newDelta=new Delta(null, false);
}
}
if (edgetoadd!=null) {
- newDelta.addHeapEdge(edgetoadd);
+ Edge match=graph.getMatch(edgetoadd);
+ if (match==null||!match.subsumes(edgetoadd)) {
+ Edge mergededge=edgetoadd.merge(match);
+ //XXXXXXXXXXXXX;
+ newDelta.addHeapEdge(mergededge);
+ }
}
}
}
newDelta.addEdge(newedge);
}
}
-
+
return newDelta;
}
MySet<Edge> backedges=graph.getBackEdges(singleNode);
for(Edge e:backedges) {
if (e.dst==singleNode) {
- Edge rewrite=e.rewrite(singleNode, summaryNode);
- newDelta.removeEdge(e);
+ //Need to get original edge so that predicate will be correct
+ Edge match=graph.getMatch(e);
+ Edge rewrite=match.rewrite(singleNode, summaryNode);
+ newDelta.removeEdge(match);
newDelta.addEdge(rewrite);
}
}
//We have a new edge
diffedges.add(e);
dstedges.add(e);
+ } else {
+ Edge origedge=dstedges.get(e);
+ if (!origedge.subsumes(e)) {
+ Edge mergededge=origedge.merge(e);
+ diffedges.add(mergededge);
+ dstedges.add(mergededge);
+ }
}
}
//Done with edge set...