Class LambdaMethodTargetSelector
java.lang.Object
com.ibm.wala.ipa.summaries.LambdaMethodTargetSelector
- All Implemented Interfaces:
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.
- A summary class corresponding to an anonymous class generated for the lambda; see
LambdaSummaryClass. - A summary method corresponding to the lambda factory generated by the bootstrap method;
this is the method actually called by
invokedynamic.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCalleeTarget(CGNode caller, CallSiteReference site, IClass receiver) Return a synthetic method target for invokedynamic calls corresponding to Java lambdasgetLambdaSummaryClass(CGNode caller, CallSiteReference site) Gets the summary class for a lambda factory, if it has already been created.
-
Constructor Details
-
LambdaMethodTargetSelector
-
-
Method Details
-
getCalleeTarget
Return a synthetic method target for invokedynamic calls corresponding to Java lambdas- Specified by:
getCalleeTargetin interfaceMethodTargetSelector- Parameters:
caller- the GCNode in the call graph containing the callsite- the call site reference of the call sitereceiver- 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
-
getLambdaSummaryClass
Gets the summary class for a lambda factory, if it has already been created.- Parameters:
caller- the caller nodesite- the call site reference- Returns:
- the summary class for the lambda factory, or
nullif it has not been created
-