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 IClassHierarchychaGoverning class hierarchy.protected MethodTargetSelectorparenttarget 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 booleancanIgnore(MemberReference m)protected SyntheticMethodfindOrCreateSyntheticMethod(IMethod m, boolean isStatic)protected SyntheticMethodfindOrCreateSyntheticMethod(MethodReference m, boolean isStatic)MethodSummarygenerateNoOp(MethodReference m, boolean isStatic)Generate aMethodSummarywhich is the "standard" representation of a method that does nothing.static MethodSummarygenerateStandardNoOp(Language l, MethodReference m, boolean isStatic)Generate aMethodSummarywhich is the "standard" representation of a method that does nothing.IMethodgetCalleeTarget(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 IClassHierarchygetClassHierarchy()
-
-
-
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:
getCalleeTargetin 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 aMethodSummarywhich is the "standard" representation of a method that does nothing.
-
generateNoOp
public MethodSummary generateNoOp(MethodReference m, boolean isStatic)
Generate aMethodSummarywhich 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()
-
-