this.parent=parent;
}
+ public HashSet<Edge> getEdges(TempDescriptor tmp) {
+ if (varMap.containsKey(tmp))
+ return varMap.get(tmp);
+ else if (parent!=null&&parent.varMap.containsKey(tmp))
+ return parent.varMap.get(tmp);
+ else return emptySet;
+ }
+
public HashSet<Edge> getEdges(AllocNode node) {
if (nodeMap.containsKey(node))
return nodeMap.get(node);
switch(node.kind()) {
case FKind.FlatNew:
return processNewNode((FlatNew)node, delta, newgraph);
- case FKind.FlatCall:
case FKind.FlatFieldNode:
+ return processFieldNode((FlatFieldNode)node, delta, newgraph);
+ case FKind.FlatCall:
case FKind.FlatSetFieldNode:
case FKind.FlatReturnNode:
case FKind.FlatElementNode:
}
}
+ HashSet<AllocNode> getTemps(Graph graph, Delta delta, TempDescriptor tmp) {
+ HashSet<AllocNode> nodes=new HashSet<AllocNode>();
+ HashSet<Edge> removeedges=delta.varedgeremove.get(tmp);
+
+ for(Edge e:graph.getEdges(tmp)) {
+ if (removeedges==null||!removeedges.contains(e))
+ nodes.add(e.dst);
+ }
+ if (delta.varedgeadd.containsKey(tmp))
+ for(Edge e:delta.varedgeadd.get(tmp)) {
+ nodes.add(e.dst);
+ }
+ return nodes;
+ }
+
+ Delta processFieldNode(FlatFieldNode node, Delta delta, Graph graph) {
+ TempDescriptor src=node.getSrc();
+ FieldDescriptor fd=node.getField();
+ TempDescriptor dst=node.getDst();
+ if (delta.getInit()) {
+ HashSet<AllocNode> nodes=getTemps(graph, delta, src);
+
+
+ applyDiffs(graph, delta);
+ } else {
+
+ }
+ return delta;
+ }
+
Delta processNewNode(FlatNew node, Delta delta, Graph graph) {
AllocNode summary=allocFactory.getAllocNode(node, true);
AllocNode single=allocFactory.getAllocNode(node, false);
//Add it into the diffs
delta.varedgeadd.put(tmp, newedges);
//Remove the old edges
- delta.varedgeremove.put(tmp, delta.basevaredge.get(tmp));
+ delta.varedgeremove.put(tmp, graph.getEdges(tmp));
//Apply incoming diffs to graph
applyDiffs(graph, delta);
} else {