com.ibm.wala.ipa.callgraph
Interface ContextSelector

All Known Implementing Classes:
CallStringContextSelector, CloneContextSelector, ContainerContextSelector, ContextInsensitiveSelector, DefaultContextSelector, DelegatingContextSelector, FactoryContextSelector, J2EEContextSelector, MiscellaneousHacksContextSelector, nCFAContextSelector, OneLevelContextSelector, OneLevelSiteContextSelector, ReceiverTypeContextSelector, TargetMethodContextSelector

public interface ContextSelector

An interface to an object which helps control context-sensitivity


Method Summary
 boolean allSitesDispatchIdentically(CGNode node, CallSiteReference site)
           
 boolean contextIsIrrelevant(CGNode node, CallSiteReference site)
           
 int getBoundOnNumberOfTargets(CGNode caller, CallSiteReference site, IMethod targetMethod)
           
 Context getCalleeTarget(CGNode caller, CallSiteReference site, IMethod callee, InstanceKey receiver)
          Given a call site, returns the Context in which the callee should be evaluated.
 boolean mayUnderstand(CGNode caller, CallSiteReference site, IMethod targetMethod, InstanceKey instance)
           
 void setWarnings(WarningSet newWarnings)
          Bind this object to a new object to track warnings
 

Method Detail

getCalleeTarget

Context getCalleeTarget(CGNode caller,
                        CallSiteReference site,
                        IMethod callee,
                        InstanceKey receiver)
Given a call site, returns the Context in which the callee should be evaluated.

Parameters:
site - description of the call site
Returns:
the Context in which the callee should be evaluated, or null if no information is available.

getBoundOnNumberOfTargets

int getBoundOnNumberOfTargets(CGNode caller,
                              CallSiteReference site,
                              IMethod targetMethod)
Returns:
a bound on the number of contexts that might be created for this target. -1 if no bound is known.

mayUnderstand

boolean mayUnderstand(CGNode caller,
                      CallSiteReference site,
                      IMethod targetMethod,
                      InstanceKey instance)
Parameters:
instance - the instance dispatched on. null means "any possible instance"
Returns:
true iff this object may understand how to select a context for the given target

setWarnings

void setWarnings(WarningSet newWarnings)
Bind this object to a new object to track warnings

Parameters:
newWarnings -

contextIsIrrelevant

boolean contextIsIrrelevant(CGNode node,
                            CallSiteReference site)
Parameters:
site -
Returns:
true iff this context selector will always return the same context for a given call site, regardless of the receiver object

allSitesDispatchIdentically

boolean allSitesDispatchIdentically(CGNode node,
                                    CallSiteReference site)
Returns:
true iff \forAll n \in nodes, \forAll s \in sites with this declaredTarget, the set of targets is the same