Class BypassMethodTargetSelector
java.lang.Object
com.ibm.wala.ipa.summaries.BypassMethodTargetSelector
- All Implemented Interfaces:
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.
- Author:
- sfink
-
Field Summary
Modifier and TypeFieldDescriptionprotected final IClassHierarchy
Governing class hierarchy.protected final MethodTargetSelector
target selector to use for non-bypassed calls -
Constructor Summary
ConstructorDescriptionBypassMethodTargetSelector
(MethodTargetSelector parent, Map<MethodReference, MethodSummary> methodSummaries, Set<Atom> ignoredPackages, IClassHierarchy cha) -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
protected SyntheticMethod
findOrCreateSyntheticMethod
(IMethod m, boolean isStatic) protected SyntheticMethod
findOrCreateSyntheticMethod
(MethodReference m, boolean isStatic) 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.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
-
Field Details
-
cha
Governing class hierarchy. -
parent
target selector to use for non-bypassed calls
-
-
Constructor Details
-
BypassMethodTargetSelector
public BypassMethodTargetSelector(MethodTargetSelector parent, Map<MethodReference, MethodSummary> methodSummaries, Set<Atom> ignoredPackages, IClassHierarchy cha)
-
-
Method Details
-
getCalleeTarget
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
- Parameters:
m
- a method reference- Returns:
- a SyntheticMethod corresponding to m; or null if none is available.
-
findOrCreateSyntheticMethod
- Parameters:
m
- a method reference- Returns:
- a SyntheticMethod corresponding to m; or null if none is available.
-
generateStandardNoOp
Generate aMethodSummary
which is the "standard" representation of a method that does nothing. -
generateNoOp
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
- Returns:
- true iff we can treat m as a no-op method
-
getClassHierarchy
-