delete redundant method SSAAbstractInvokeInstruction.getSite()
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2291 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
This commit is contained in:
parent
2789df69e7
commit
d62532dbca
|
@ -1054,7 +1054,7 @@ public class DemandRefinementPointsTo extends AbstractDemandPointsTo {
|
||||||
CGNode caller = localPk.getNode();
|
CGNode caller = localPk.getNode();
|
||||||
boolean isExceptional = localPk.getValueNumber() == callInstr.getException();
|
boolean isExceptional = localPk.getValueNumber() == callInstr.getException();
|
||||||
|
|
||||||
CallSiteReference callSiteRef = callInstr.getSite();
|
CallSiteReference callSiteRef = callInstr.getCallSite();
|
||||||
CallSiteAndCGNode callSiteAndCGNode = new CallSiteAndCGNode(callSiteRef, caller);
|
CallSiteAndCGNode callSiteAndCGNode = new CallSiteAndCGNode(callSiteRef, caller);
|
||||||
// get call targets
|
// get call targets
|
||||||
Set<CGNode> possibleCallees = cg.getPossibleTargets(caller, callSiteRef);
|
Set<CGNode> possibleCallees = cg.getPossibleTargets(caller, callSiteRef);
|
||||||
|
@ -1373,7 +1373,7 @@ public class DemandRefinementPointsTo extends AbstractDemandPointsTo {
|
||||||
for (int i = 0; i < callInstr.getNumberOfUses(); i++) {
|
for (int i = 0; i < callInstr.getNumberOfUses(); i++) {
|
||||||
if (localPk.getValueNumber() != callInstr.getUse(i))
|
if (localPk.getValueNumber() != callInstr.getUse(i))
|
||||||
continue;
|
continue;
|
||||||
CallSiteReference callSiteRef = callInstr.getSite();
|
CallSiteReference callSiteRef = callInstr.getCallSite();
|
||||||
CallSiteAndCGNode callSiteAndCGNode = new CallSiteAndCGNode(callSiteRef, caller);
|
CallSiteAndCGNode callSiteAndCGNode = new CallSiteAndCGNode(callSiteRef, caller);
|
||||||
// get call targets
|
// get call targets
|
||||||
Set<CGNode> possibleCallees = cg.getPossibleTargets(caller, callSiteRef);
|
Set<CGNode> possibleCallees = cg.getPossibleTargets(caller, callSiteRef);
|
||||||
|
|
|
@ -176,7 +176,7 @@ public class TestNewGraphPointsTo extends AbstractDemandPointsTo {
|
||||||
if (callInstr != null) {
|
if (callInstr != null) {
|
||||||
boolean isExceptional = localPk.getValueNumber() == callInstr.getException();
|
boolean isExceptional = localPk.getValueNumber() == callInstr.getException();
|
||||||
|
|
||||||
CallSiteReference callSiteRef = callInstr.getSite();
|
CallSiteReference callSiteRef = callInstr.getCallSite();
|
||||||
// get call targets
|
// get call targets
|
||||||
Set<CGNode> possibleCallees = cg.getPossibleTargets(localPk.getNode(), callSiteRef);
|
Set<CGNode> possibleCallees = cg.getPossibleTargets(localPk.getNode(), callSiteRef);
|
||||||
// construct graph for each target
|
// construct graph for each target
|
||||||
|
|
|
@ -246,7 +246,7 @@ public abstract class DemandFlowGraph extends FlowLabelGraph {
|
||||||
for (int i = 0; i < callInstr.getNumberOfUses(); i++) {
|
for (int i = 0; i < callInstr.getNumberOfUses(); i++) {
|
||||||
if (pk.getValueNumber() != callInstr.getUse(i))
|
if (pk.getValueNumber() != callInstr.getUse(i))
|
||||||
continue;
|
continue;
|
||||||
CallSiteReference callSiteRef = callInstr.getSite();
|
CallSiteReference callSiteRef = callInstr.getCallSite();
|
||||||
// get call targets
|
// get call targets
|
||||||
Collection<CGNode> possibleCallees = cg.getPossibleTargets(pk.getNode(), callSiteRef);
|
Collection<CGNode> possibleCallees = cg.getPossibleTargets(pk.getNode(), callSiteRef);
|
||||||
// construct graph for each target
|
// construct graph for each target
|
||||||
|
@ -290,7 +290,7 @@ public abstract class DemandFlowGraph extends FlowLabelGraph {
|
||||||
ArrayList<PointerKeyAndCallSite> returnSuccs = new ArrayList<PointerKeyAndCallSite>();
|
ArrayList<PointerKeyAndCallSite> returnSuccs = new ArrayList<PointerKeyAndCallSite>();
|
||||||
boolean isExceptional = pk.getValueNumber() == callInstr.getException();
|
boolean isExceptional = pk.getValueNumber() == callInstr.getException();
|
||||||
|
|
||||||
CallSiteReference callSiteRef = callInstr.getSite();
|
CallSiteReference callSiteRef = callInstr.getCallSite();
|
||||||
// get call targets
|
// get call targets
|
||||||
Collection<CGNode> possibleCallees = cg.getPossibleTargets(pk.getNode(), callSiteRef);
|
Collection<CGNode> possibleCallees = cg.getPossibleTargets(pk.getNode(), callSiteRef);
|
||||||
// construct graph for each target
|
// construct graph for each target
|
||||||
|
|
|
@ -333,7 +333,7 @@ public class SimpleDemandPointerFlowGraph extends SlowSparseNumberedGraph<Object
|
||||||
boolean isExceptional = pk.getValueNumber() == callInstr.getException();
|
boolean isExceptional = pk.getValueNumber() == callInstr.getException();
|
||||||
|
|
||||||
// get call targets
|
// get call targets
|
||||||
Collection<CGNode> possibleCallees = cg.getPossibleTargets(pk.getNode(), callInstr.getSite());
|
Collection<CGNode> possibleCallees = cg.getPossibleTargets(pk.getNode(), callInstr.getCallSite());
|
||||||
// construct graph for each target
|
// construct graph for each target
|
||||||
for (CGNode callee : possibleCallees) {
|
for (CGNode callee : possibleCallees) {
|
||||||
addSubgraphForNode(callee);
|
addSubgraphForNode(callee);
|
||||||
|
|
|
@ -1463,7 +1463,7 @@ public abstract class SSAPropagationCallGraphBuilder extends PropagationCallGrap
|
||||||
caller.addTarget(instruction.getCallSite(), target);
|
caller.addTarget(instruction.getCallSite(), target);
|
||||||
|
|
||||||
if (FakeRootMethod.isFakeRootMethod(caller.getMethod().getReference())) {
|
if (FakeRootMethod.isFakeRootMethod(caller.getMethod().getReference())) {
|
||||||
if (entrypointCallSites.contains(instruction.getSite())) {
|
if (entrypointCallSites.contains(instruction.getCallSite())) {
|
||||||
callGraph.registerEntrypoint(target);
|
callGraph.registerEntrypoint(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1509,7 +1509,7 @@ public abstract class SSAPropagationCallGraphBuilder extends PropagationCallGrap
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
boolean needsFilter = !instruction.getSite().isStatic() && needsFilterForReceiver(instruction, target);
|
boolean needsFilter = !instruction.getCallSite().isStatic() && needsFilterForReceiver(instruction, target);
|
||||||
// we're a little sloppy for now ... we don't filter calls to
|
// we're a little sloppy for now ... we don't filter calls to
|
||||||
// java.lang.Object.
|
// java.lang.Object.
|
||||||
// TODO: we need much more precise filters than cones in order to handle
|
// TODO: we need much more precise filters than cones in order to handle
|
||||||
|
@ -1683,7 +1683,7 @@ public abstract class SSAPropagationCallGraphBuilder extends PropagationCallGrap
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
target = getTargetForCall(node, call.getSite(), iKey);
|
target = getTargetForCall(node, call.getCallSite(), iKey);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
// This indicates an error; I sure hope getTargetForCall
|
// This indicates an error; I sure hope getTargetForCall
|
||||||
|
@ -1733,17 +1733,17 @@ public abstract class SSAPropagationCallGraphBuilder extends PropagationCallGrap
|
||||||
* @return true iff we never have to eval this dispatch operator again
|
* @return true iff we never have to eval this dispatch operator again
|
||||||
*/
|
*/
|
||||||
private boolean willNeverChangeAgain(IntSet receivers) {
|
private boolean willNeverChangeAgain(IntSet receivers) {
|
||||||
int bound = getBoundOnNumberOfTargets(node, call.getSite());
|
int bound = getBoundOnNumberOfTargets(node, call.getCallSite());
|
||||||
if (bound > -1) {
|
if (bound > -1) {
|
||||||
int nTargets = getCallGraph().getNumberOfTargets(node, call.getSite());
|
int nTargets = getCallGraph().getNumberOfTargets(node, call.getCallSite());
|
||||||
if (Assertions.verifyAssertions) {
|
if (Assertions.verifyAssertions) {
|
||||||
if (nTargets > bound) {
|
if (nTargets > bound) {
|
||||||
Trace.println("node: " + node);
|
Trace.println("node: " + node);
|
||||||
Trace.println("site: " + call.getSite());
|
Trace.println("site: " + call.getCallSite());
|
||||||
Trace.println("instruction " + call);
|
Trace.println("instruction " + call);
|
||||||
Trace.println("nTargets: " + nTargets);
|
Trace.println("nTargets: " + nTargets);
|
||||||
Trace.println("bound: " + bound);
|
Trace.println("bound: " + bound);
|
||||||
for (Iterator it = getCallGraph().getPossibleTargets(node, call.getSite()).iterator(); it.hasNext();) {
|
for (Iterator it = getCallGraph().getPossibleTargets(node, call.getCallSite()).iterator(); it.hasNext();) {
|
||||||
Trace.println(" " + it.next());
|
Trace.println(" " + it.next());
|
||||||
}
|
}
|
||||||
for (IntIterator intIt = receivers.intIterator(); intIt.hasNext();) {
|
for (IntIterator intIt = receivers.intIterator(); intIt.hasNext();) {
|
||||||
|
@ -1915,7 +1915,7 @@ public abstract class SSAPropagationCallGraphBuilder extends PropagationCallGrap
|
||||||
}
|
}
|
||||||
|
|
||||||
// don't need to filter for invokestatic
|
// don't need to filter for invokestatic
|
||||||
if (instruction.getSite().isStatic() || instruction.getSite().isSpecial()) {
|
if (instruction.getCallSite().isStatic() || instruction.getCallSite().isSpecial()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -552,7 +552,7 @@ public abstract class IR {
|
||||||
public CallSiteReference next() {
|
public CallSiteReference next() {
|
||||||
int index = callSiteMapping.getRelated(i).max();
|
int index = callSiteMapping.getRelated(i).max();
|
||||||
advance();
|
advance();
|
||||||
return ((SSAAbstractInvokeInstruction) instructions[index]).getSite();
|
return ((SSAAbstractInvokeInstruction) instructions[index]).getCallSite();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void remove() {
|
public void remove() {
|
||||||
|
|
|
@ -43,20 +43,16 @@ public abstract class SSAAbstractInvokeInstruction extends SSAInstruction implem
|
||||||
return site;
|
return site;
|
||||||
}
|
}
|
||||||
|
|
||||||
public CallSiteReference getSite() {
|
|
||||||
return site;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isStatic() {
|
public boolean isStatic() {
|
||||||
return getSite().isStatic();
|
return getCallSite().isStatic();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDispatch() {
|
public boolean isDispatch() {
|
||||||
return getSite().isDispatch();
|
return getCallSite().isDispatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSpecial() {
|
public boolean isSpecial() {
|
||||||
return getSite().isSpecial();
|
return getCallSite().isSpecial();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue