Class InvokeDynamicInfo
- java.lang.Object
-
- com.tonic.analysis.execution.dispatch.InvokeDynamicInfo
-
public final class InvokeDynamicInfo extends Object
An invokedynamic call site: bootstrap method index plus the invoked name and descriptor.
-
-
Constructor Summary
Constructors Constructor Description InvokeDynamicInfo(int bootstrapMethodIndex, String methodName, String descriptor, int constantPoolIndex)Creates an invokedynamic call site descriptor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetBootstrapMethodIndex()intgetConstantPoolIndex()StringgetDescriptor()StringgetMethodName()intgetParameterCount()Counts the parameters declared in the descriptor.intgetParameterSlots()Counts the local-variable slots consumed by the parameters.StringgetReturnType()Extracts the return type from the descriptor.booleanisLambdaMetafactory()Checks whether the invoked name matches a common functional-interface method, indicating a LambdaMetafactory call site.booleanisStringConcat()Checks whether this is a StringConcatFactory call site.booleanisVoidReturn()Checks whether the call site returns void.StringtoString()
-
-
-
Constructor Detail
-
InvokeDynamicInfo
public InvokeDynamicInfo(int bootstrapMethodIndex, String methodName, String descriptor, int constantPoolIndex)Creates an invokedynamic call site descriptor.- Parameters:
bootstrapMethodIndex- index into the BootstrapMethods attributemethodName- the invoked name of the call sitedescriptor- the call site's method descriptorconstantPoolIndex- index of the entry in the constant pool
-
-
Method Detail
-
getBootstrapMethodIndex
public int getBootstrapMethodIndex()
- Returns:
- the bootstrap method index
-
getMethodName
public String getMethodName()
- Returns:
- the method name
-
getDescriptor
public String getDescriptor()
- Returns:
- the descriptor
-
getConstantPoolIndex
public int getConstantPoolIndex()
- Returns:
- the constant pool index
-
getParameterSlots
public int getParameterSlots()
Counts the local-variable slots consumed by the parameters.- Returns:
- the total slot count, with long and double counting as two
-
getParameterCount
public int getParameterCount()
Counts the parameters declared in the descriptor.- Returns:
- the number of parameters, or 0 for a missing or malformed descriptor
-
getReturnType
public String getReturnType()
Extracts the return type from the descriptor.- Returns:
- the return type descriptor, or "V" if it cannot be parsed
-
isVoidReturn
public boolean isVoidReturn()
Checks whether the call site returns void.- Returns:
- true if the return type is "V"
-
isLambdaMetafactory
public boolean isLambdaMetafactory()
Checks whether the invoked name matches a common functional-interface method, indicating a LambdaMetafactory call site.- Returns:
- true if the name is a known functional-interface method name
-
isStringConcat
public boolean isStringConcat()
Checks whether this is a StringConcatFactory call site.- Returns:
- true if the invoked name is makeConcat or makeConcatWithConstants
-
-