Class LambdaMethodTargetSelector

java.lang.Object
com.ibm.wala.ipa.summaries.LambdaMethodTargetSelector
All Implemented Interfaces:
MethodTargetSelector

public class LambdaMethodTargetSelector extends Object implements MethodTargetSelector
Generates synthetic summaries to model the behavior of Java 8 lambdas. See this good discussion of how lambdas look in bytecode.

We generate two types of summaries.

  1. A summary class corresponding to an anonymous class generated for the lambda; see LambdaSummaryClass.
  2. A summary method corresponding to the lambda factory generated by the bootstrap method; this is the method actually called by invokedynamic.
  • Constructor Details

  • Method Details

    • getCalleeTarget

      public IMethod getCalleeTarget(CGNode caller, CallSiteReference site, IClass receiver)
      Return a synthetic method target for invokedynamic calls corresponding to Java lambdas
      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
      receiver - the type of the target object or null
      Returns:
      a synthetic method if the call is an invokedynamic for Java lambdas; the callee target from the base selector otherwise