HashMap<FlatCall, Set<BBlock>> callMap;
HashMap<BBlock, Set<PPoint>> returnMap;
HashMap<BBlock, Set<TempDescriptor>> bblivetemps;
+ HashSet<FlatNode> mustProcess;
private boolean OoOJava=false;
CallGraph callGraph;
this.toprocess=new LinkedList<Delta>();
ClassDescriptor stringcd=typeUtil.getClass(TypeUtil.ObjectClass);
this.returntmp=new TempDescriptor("RETURNVAL", stringcd);
+ this.mustProcess=new HashSet<FlatNode>();
}
public EffectsAnalysis getEffectsAnalysis() {
if (isNEEDED(currNode))
graphMap.put(currNode, new Graph(graph));
else {
- if (i==0) {
+ if (i==(nodes.size()-1)&&isINACC(currNode)) {
+ mustProcess.add(currNode);
+ graphMap.put(currNode, new Graph(graph));
+ } else if (i==0) {
//base graph works for us
graphMap.put(currNode, new Graph(graph));
} else {
}
//DEBUG
- if (false) {
+ if (true) {
int debugindex=0;
for(Map.Entry<BBlock, Graph> e:bbgraphMap.entrySet()) {
Graph g=e.getValue();
}
for(FlatMethod fm:blockMap.keySet()) {
- System.out.println(fm.printMethod());
+ System.out.println(fm.printMethod(accessible.inAccessible));
}
for(Map.Entry<FlatNode, Graph> e:graphMap.entrySet()) {
FlatNode fn=e.getKey();
graph.oldNodes.put(node, ispresent);
}
}
+
+ boolean isINACC(FlatNode node) {
+ if (!OoOJava)
+ return false;
+ switch(node.kind()) {
+ case FKind.FlatSetFieldNode: {
+ FlatSetFieldNode n=(FlatSetFieldNode)node;
+ return !accessible.isAccessible(n, n.getDst());
+ }
+ case FKind.FlatSetElementNode: {
+ FlatSetElementNode n=(FlatSetElementNode)node;
+ return !accessible.isAccessible(n, n.getDst());
+ }
+ case FKind.FlatFieldNode: {
+ FlatFieldNode n=(FlatFieldNode)node;
+ return !accessible.isAccessible(n, n.getSrc());
+ }
+ case FKind.FlatElementNode: {
+ FlatElementNode n=(FlatElementNode)node;
+ return !accessible.isAccessible(n, n.getSrc());
+ }
+ }
+ return false;
+ }
+
Delta processSetFieldElementNode(FlatNode node, Delta delta, Graph graph) {
TempDescriptor src;
FieldDescriptor fd;
//Do nothing for non pointers
if (!src.getType().isPtr()) {
+ if (mustProcess.contains(node)) {
+ applyDiffs(graph, delta);
+ }
return delta;
}
}
if (!src.getType().isPtr()) {
+ if (mustProcess.contains(node)) {
+ applyDiffs(graph, delta);
+ }
return delta;
}
}
effectsAnalysis.analyzeFlatFieldNode(srcedges, fd, node);
}
- if (!dst.getType().isPtr())
+ if (!dst.getType().isPtr()) {
+ if (mustProcess.contains(node)) {
+ applyDiffs(graph, delta);
+ }
return delta;
+ }
MySet<Edge> edgesToAdd=GraphManip.dereference(graph, delta, dst, srcedges, fd, node);
MySet<Edge> edgesToRemove=GraphManip.getEdges(graph, delta, dst);
}
effectsAnalysis.analyzeFlatFieldNode(newsrcedges, fd, node);
}
- if (!dst.getType().isPtr())
+ if (!dst.getType().isPtr()) {
+ if (mustProcess.contains(node)) {
+ applyDiffs(graph, delta);
+ }
return delta;
-
+ }
/* First compute new objects we read fields of */
MySet<Edge> allsrcedges=GraphManip.getEdges(graph, delta, src);
MySet<Edge> edgesToAdd=GraphManip.diffDereference(delta, dst, allsrcedges, fd, node);