Record Class DynamicInvokeTarget

java.lang.Object
java.lang.Record
sootup.callgraph.invokedynamic.DynamicInvokeTarget
Record Components:
method - the referenced method, as written in the method handle (not dispatched yet)
kind - how the method handle invokes method
lambdaImplementation - whether method implements a LambdaMetafactory call site, i.e. the call site's arguments are values captured for it

public record DynamicInvokeTarget(@NonNull MethodSignature method, @NonNull MethodHandle.Kind kind, boolean lambdaImplementation) extends Record
A method an invokedynamic call site transfers control to.
  • Field Details

  • Constructor Details

    • DynamicInvokeTarget

      public DynamicInvokeTarget(@NonNull MethodSignature method, @NonNull MethodHandle.Kind kind, boolean lambdaImplementation)
      Creates an instance of a DynamicInvokeTarget record class.
      Parameters:
      method - the value for the method record component
      kind - the value for the kind record component
      lambdaImplementation - the value for the lambdaImplementation record component
  • Method Details

    • captureParameterIndex

      public int captureParameterIndex(int argIndex)
      Where the invokedynamic's argIndex-th argument lands in method(): RECEIVER for a captured receiver (obj::m, or this of an instance lambda body), else the parameter index - captured values precede the functional interface's own arguments. NOT_BOUND unless this is a lambdaImplementation().
    • hasReceiver

      public boolean hasReceiver()
      Whether method() is invoked on a receiver object (not static, not a constructor).
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • method

      public @NonNull MethodSignature method()
      Returns the value of the method record component.
      Returns:
      the value of the method record component
    • kind

      public @NonNull MethodHandle.Kind kind()
      Returns the value of the kind record component.
      Returns:
      the value of the kind record component
    • lambdaImplementation

      public boolean lambdaImplementation()
      Returns the value of the lambdaImplementation record component.
      Returns:
      the value of the lambdaImplementation record component