diff --git a/src/main/java/soot/jimple/spark/pag/PAG.java b/src/main/java/soot/jimple/spark/pag/PAG.java index 2becab251cb..aea9d75289d 100644 --- a/src/main/java/soot/jimple/spark/pag/PAG.java +++ b/src/main/java/soot/jimple/spark/pag/PAG.java @@ -92,7 +92,6 @@ import soot.toolkits.scalar.Pair; import soot.util.ArrayNumberer; import soot.util.HashMultiMap; -import soot.util.LargeNumberedMap; import soot.util.MultiMap; import soot.util.queue.ChunkedQueue; import soot.util.queue.QueueReader; @@ -736,9 +735,6 @@ public LocalVarNode makeLocalVarNode(Object value, Type type, SootMethod method) method = null; } else if (value instanceof Local) { Local val = (Local) value; - if (val.getNumber() == 0) { - Scene.v().getLocalNumberer().add(val); - } LocalVarNode ret = localToNodeMap.get(val); if (ret == null) { localToNodeMap.put((Local) value, ret = new LocalVarNode(this, value, type, method)); @@ -1545,7 +1541,7 @@ protected boolean addToMap(Map m, K key, Node value) private OnFlyCallGraph ofcg; private final ArrayList dereferences = new ArrayList(); protected TypeManager typeManager; - private final LargeNumberedMap localToNodeMap = new LargeNumberedMap<>(Scene.v().getLocalNumberer()); + protected Map localToNodeMap = new HashMap<>(); private final Map newInstToNodeMap = new HashMap<>(); public int maxFinishNumber = 0; private Map nodeToTag; diff --git a/src/main/java/soot/jimple/toolkits/callgraph/OnFlyCallGraphBuilder.java b/src/main/java/soot/jimple/toolkits/callgraph/OnFlyCallGraphBuilder.java index 76ee54fd838..ee536af1887 100644 --- a/src/main/java/soot/jimple/toolkits/callgraph/OnFlyCallGraphBuilder.java +++ b/src/main/java/soot/jimple/toolkits/callgraph/OnFlyCallGraphBuilder.java @@ -22,12 +22,11 @@ * #L% */ -import java.lang.reflect.Constructor; -import java.lang.reflect.Method; import java.util.ArrayList; import java.util.BitSet; import java.util.Collection; import java.util.Collections; +import java.util.HashMap; import java.util.HashSet; import java.util.IdentityHashMap; import java.util.Iterator; @@ -95,7 +94,6 @@ import soot.jimple.StringConstant; import soot.jimple.VirtualInvokeExpr; import soot.jimple.spark.pag.AllocDotField; -import soot.jimple.spark.pag.PAG; import soot.jimple.toolkits.annotation.nullcheck.NullnessAnalysis; import soot.jimple.toolkits.callgraph.ConstantArrayAnalysis.ArrayTypes; import soot.jimple.toolkits.callgraph.VirtualEdgesSummaries.DirectTarget; @@ -113,7 +111,6 @@ import soot.util.LargeNumberedMap; import soot.util.MultiMap; import soot.util.NumberedString; -import soot.util.SmallNumberedMap; import soot.util.StringNumberer; import soot.util.queue.ChunkedQueue; import soot.util.queue.QueueReader; @@ -167,12 +164,12 @@ public class OnFlyCallGraphBuilder { private final CallGraph cicg = Scene.v().internalMakeCallGraph(); // end type based reflection resolution - protected final LargeNumberedMap> receiverToSites; + protected final Map> receiverToSites; protected final LargeNumberedMap> methodToReceivers; protected final LargeNumberedMap> methodToInvokeBases; protected final LargeNumberedMap> methodToInvokeArgs; protected final LargeNumberedMap> methodToStringConstants; - protected final SmallNumberedMap> stringConstToSites; + protected final Map> stringConstToSites; protected final HashSet analyzedMethods = new HashSet(); protected final MultiMap baseToInvokeSite = new HashMultiMap<>(); @@ -212,13 +209,13 @@ public OnFlyCallGraphBuilder(ContextManager cm, ReachableMethods rm, boolean app this.sigForName = nmbr.findOrAdd(JavaMethods.SIG_INIT); } { - this.receiverToSites = new LargeNumberedMap>(sc.getLocalNumberer()); + this.receiverToSites = new HashMap>(); final IterableNumberer methodNumberer = sc.getMethodNumberer(); this.methodToReceivers = new LargeNumberedMap>(methodNumberer); this.methodToInvokeBases = new LargeNumberedMap>(methodNumberer); this.methodToInvokeArgs = new LargeNumberedMap>(methodNumberer); this.methodToStringConstants = new LargeNumberedMap>(methodNumberer); - this.stringConstToSites = new SmallNumberedMap>(); + this.stringConstToSites = new HashMap>(); } this.cm = cm; @@ -877,7 +874,7 @@ public Set getReceiversOfVirtualEdge(VirtualEdgeTarget edgeTarget, Invoke if (edgeTarget instanceof VirtualEdgesSummaries.IndirectTarget) { VirtualEdgesSummaries.IndirectTarget indirectTarget = (VirtualEdgesSummaries.IndirectTarget) edgeTarget; // Recursion case: We have an indirect target, which leads us to the statement where the local, - // that gets $this inside the callee, resides. + // that gets $this inside the callee, resides. // First find the receiver of another call Local l = getLocalForTarget(invokeExpr, edgeTarget); @@ -908,7 +905,7 @@ public Set getReceiversOfVirtualEdge(VirtualEdgeTarget edgeTarget, Invoke assert edgeTarget instanceof DirectTarget; // Base case: Lookup the value based on the index referenced by the VirtualEdgeTarget. - // That local represents the $this local inside the callee. + // That local represents the $this local inside the callee. Local l = getLocalForTarget(invokeExpr, edgeTarget); return l == null ? Collections.emptySet() : Collections.singleton(l); }