Package com.ibm.wala.ipa.summaries
Class BypassMethodTargetSelector
- java.lang.Object
-
- com.ibm.wala.ipa.summaries.BypassMethodTargetSelector
-
- All Implemented Interfaces:
MethodTargetSelector
public class BypassMethodTargetSelector extends Object implements MethodTargetSelector
"Non-standard" bypass rules to use during call graph construction. Normally, the method bypass rules replace the IMethod that is resolved by other means, via the getBypass() method. However, the bypass rules can be invoked even before resolving the target of a call, by checking the intercept rules.
-
-
Field Summary
Fields Modifier and Type Field Description protected IClassHierarchy
cha
Governing class hierarchy.protected MethodTargetSelector
parent
target selector to use for non-bypassed calls
-
Constructor Summary
Constructors Constructor Description BypassMethodTargetSelector(MethodTargetSelector parent, Map<MethodReference,MethodSummary> methodSummaries, Set<Atom> ignoredPackages, IClassHierarchy cha)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
canIgnore(MemberReference m)
protected SyntheticMethod
findOrCreateSyntheticMethod(IMethod m, boolean isStatic)
protected SyntheticMethod
findOrCreateSyntheticMethod(MethodReference m, boolean isStatic)
MethodSummary
generateNoOp(MethodReference m, boolean isStatic)
Generate aMethodSummary
which is the "standard" representation of a method that does nothing.static MethodSummary
generateStandardNoOp(Language l, MethodReference m, boolean isStatic)
Generate aMethodSummary
which is the "standard" representation of a method that does nothing.IMethod
getCalleeTarget(CGNode caller, CallSiteReference site, IClass dispatchType)
Check to see if a particular call site should be bypassed, before checking normal resolution of the receiver.protected IClassHierarchy
getClassHierarchy()
-
-
-
Field Detail
-
cha
protected final IClassHierarchy cha
Governing class hierarchy.
-
parent
protected final MethodTargetSelector parent
target selector to use for non-bypassed calls
-
-
Constructor Detail
-
BypassMethodTargetSelector
public BypassMethodTargetSelector(MethodTargetSelector parent, Map<MethodReference,MethodSummary> methodSummaries, Set<Atom> ignoredPackages, IClassHierarchy cha)
- Parameters:
parent
-methodSummaries
-ignoredPackages
-cha
-
-
-
Method Detail
-
getCalleeTarget
public IMethod getCalleeTarget(CGNode caller, CallSiteReference site, IClass dispatchType)
Check to see if a particular call site should be bypassed, before checking normal resolution of the receiver.- Specified by:
getCalleeTarget
in interfaceMethodTargetSelector
- Parameters:
caller
- the GCNode in the call graph containing the callsite
- the call site reference of the call sitedispatchType
- the type of the target object or null- Returns:
- the method to be called.
- Throws:
IllegalArgumentException
- if site is null
-
findOrCreateSyntheticMethod
protected SyntheticMethod findOrCreateSyntheticMethod(MethodReference m, boolean isStatic)
- Parameters:
m
- a method reference- Returns:
- a SyntheticMethod corresponding to m; or null if none is available.
-
findOrCreateSyntheticMethod
protected SyntheticMethod findOrCreateSyntheticMethod(IMethod m, boolean isStatic)
- Parameters:
m
- a method reference- Returns:
- a SyntheticMethod corresponding to m; or null if none is available.
-
generateStandardNoOp
public static MethodSummary generateStandardNoOp(Language l, MethodReference m, boolean isStatic)
Generate aMethodSummary
which is the "standard" representation of a method that does nothing.
-
generateNoOp
public MethodSummary generateNoOp(MethodReference m, boolean isStatic)
Generate aMethodSummary
which is the "standard" representation of a method that does nothing. Subclasses may override this method to implement alternative semantics concerning what "do nothing" means.
-
canIgnore
protected boolean canIgnore(MemberReference m)
- Parameters:
m
-- Returns:
- true iff we can treat m as a no-op method
-
getClassHierarchy
protected IClassHierarchy getClassHierarchy()
-
-