Package sootup.callgraph.invokedynamic
Class BootstrapMethodHandleResolver
java.lang.Object
sootup.callgraph.invokedynamic.BootstrapMethodHandleResolver
- All Implemented Interfaces:
DynamicInvokeResolver
Resolves an invokedynamic call site to every method referenced by a
MethodHandle among
its bootstrap arguments. For LambdaMetafactory call sites that is the lambda body or
method reference, marked as DynamicInvokeTarget.lambdaImplementation() so pointer
analyses can bind captured values. Other bootstraps (e.g. ObjectMethods for records)
contribute their method handles as plain targets.-
Method Summary
Modifier and TypeMethodDescription@NonNull Bodydesugar(@NonNull SootMethod method, @NonNull Body body, @NonNull View view) AppliesInvokeDynamicDesugarer(string concatenation, record methods) unless the view's frontend already did.static booleanisLambdaMetafactory(@NonNull JDynamicInvokeExpr expr) Whetherexpris bootstrapped byLambdaMetafactory.(alt)metafactory.static @Nullable MethodHandlelambdaImplementationHandle(@NonNull JDynamicInvokeExpr expr) The implementation method handle of aLambdaMetafactorycall site - its firstMethodHandlebootstrap argument - ornullifexpris not one.@NonNull List<DynamicInvokeTarget>resolve(@NonNull JDynamicInvokeExpr expr) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface sootup.callgraph.invokedynamic.DynamicInvokeResolver
creationSiteEdges, creationSiteTargets, isNone, withCreationSiteEdges
-
Method Details
-
desugar
AppliesInvokeDynamicDesugarer(string concatenation, record methods) unless the view's frontend already did.- Specified by:
desugarin interfaceDynamicInvokeResolver- Returns:
bodyitself if nothing changed, else a rewritten copy - the same one on each call, so statements of call graph edges and of later passes over the body match
-
resolve
- Specified by:
resolvein interfaceDynamicInvokeResolver- Parameters:
expr- the invokedynamic expression- Returns:
- the methods
exprmay transfer control to; empty if unresolved
-
isLambdaMetafactory
Whetherexpris bootstrapped byLambdaMetafactory.(alt)metafactory. -
lambdaImplementationHandle
The implementation method handle of aLambdaMetafactorycall site - its firstMethodHandlebootstrap argument - ornullifexpris not one.
-