Package sootup.callgraph.invokedynamic
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 invokesmethodlambdaImplementation- whethermethodimplements aLambdaMetafactorycall 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 Summary
FieldsModifier and TypeFieldDescriptionstatic final intcaptureParameterIndex(int)result for an argument that does not reach the target.static final intcaptureParameterIndex(int)result for a captured receiver. -
Constructor Summary
ConstructorsConstructorDescriptionDynamicInvokeTarget(@NonNull MethodSignature method, @NonNull MethodHandle.Kind kind, boolean lambdaImplementation) Creates an instance of aDynamicInvokeTargetrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintcaptureParameterIndex(int argIndex) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.booleanWhethermethod()is invoked on a receiver object (not static, not a constructor).@NonNull MethodHandle.Kindkind()Returns the value of thekindrecord component.booleanReturns the value of thelambdaImplementationrecord component.@NonNull MethodSignaturemethod()Returns the value of themethodrecord component.final StringtoString()Returns a string representation of this record class.
-
Field Details
-
RECEIVER
public static final int RECEIVERcaptureParameterIndex(int)result for a captured receiver.- See Also:
-
NOT_BOUND
public static final int NOT_BOUNDcaptureParameterIndex(int)result for an argument that does not reach the target.- See Also:
-
-
Constructor Details
-
DynamicInvokeTarget
public DynamicInvokeTarget(@NonNull MethodSignature method, @NonNull MethodHandle.Kind kind, boolean lambdaImplementation) Creates an instance of aDynamicInvokeTargetrecord class.- Parameters:
method- the value for themethodrecord componentkind- the value for thekindrecord componentlambdaImplementation- the value for thelambdaImplementationrecord component
-
-
Method Details
-
captureParameterIndex
public int captureParameterIndex(int argIndex) Where the invokedynamic'sargIndex-th argument lands inmethod():RECEIVERfor a captured receiver (obj::m, orthisof an instance lambda body), else the parameter index - captured values precede the functional interface's own arguments.NOT_BOUNDunless this is alambdaImplementation(). -
hasReceiver
public boolean hasReceiver()Whethermethod()is invoked on a receiver object (not static, not a constructor). -
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. -
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. -
equals
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
method
Returns the value of themethodrecord component.- Returns:
- the value of the
methodrecord component
-
kind
Returns the value of thekindrecord component.- Returns:
- the value of the
kindrecord component
-
lambdaImplementation
public boolean lambdaImplementation()Returns the value of thelambdaImplementationrecord component.- Returns:
- the value of the
lambdaImplementationrecord component
-