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.

Author:
sfink
  • Field Details

  • Constructor Details

  • Method Details

    • 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 interface MethodTargetSelector
      Parameters:
      caller - the GCNode in the call graph containing the call
      site - the call site reference of the call site
      dispatchType - 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 a MethodSummary which is the "standard" representation of a method that does nothing.
    • generateNoOp

      public MethodSummary generateNoOp(MethodReference m, boolean isStatic)
      Generate a MethodSummary 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)
      Returns:
      true iff we can treat m as a no-op method
    • getClassHierarchy

      protected IClassHierarchy getClassHierarchy()