Interface DynamicInvokeResolver

All Known Implementing Classes:
BootstrapMethodHandleResolver
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface DynamicInvokeResolver
Decides which methods an invokedynamic call site transfers control to. Shared by CHA, RTA, Spark and Qilin (configured via CallGraphConfigBuilder.dynamicInvokeResolver(...)), so all algorithms agree on which lambda bodies / method references are reachable.

Edges to the returned targets are attributed to the invokedynamic statement itself, not to the later functional-interface call site. Pointer analyses bind the call site's arguments (the captured values) as DynamicInvokeTarget.captureParameterIndex(int) says; no return value flows back, since the invokedynamic produces the functional object, not the target's result.

  • Method Details

    • resolve

      @NonNull List<DynamicInvokeTarget> resolve(@NonNull JDynamicInvokeExpr expr)
      Parameters:
      expr - the invokedynamic expression
      Returns:
      the methods expr may transfer control to; empty if unresolved
    • none

      static @NonNull DynamicInvokeResolver none()
      Resolves nothing: invokedynamic call sites get no call targets.
    • bootstrapMethodHandles

      static @NonNull DynamicInvokeResolver bootstrapMethodHandles()
      Every method referenced by a MethodHandle bootstrap argument is a target, e.g. the synthetic lambda body passed to LambdaMetafactory. The default everywhere.
    • isNone

      default boolean isNone()
      Whether this resolver is none().