Package com.tonic.analysis.ssa.ir
Class InvokeInstruction
- java.lang.Object
-
- com.tonic.analysis.ssa.ir.IRInstruction
-
- com.tonic.analysis.ssa.ir.InvokeInstruction
-
public class InvokeInstruction extends IRInstruction
A method invocation of any dispatch kind, including invokedynamic with bootstrap info.
-
-
Constructor Summary
Constructors Constructor Description InvokeInstruction(InvokeType invokeType, String owner, String name, String descriptor, List<Value> arguments)Creates a void invocation with no constant pool index or bootstrap method.InvokeInstruction(InvokeType invokeType, String owner, String name, String descriptor, List<Value> arguments, int originalCpIndex)Creates a void invocation with no bootstrap method.InvokeInstruction(InvokeType invokeType, String owner, String name, String descriptor, List<Value> arguments, int originalCpIndex, BootstrapMethodInfo bootstrapInfo)Creates a void invocation and registers uses of its SSA arguments.InvokeInstruction(SSAValue result, InvokeType invokeType, String owner, String name, String descriptor, List<Value> arguments)Creates a value-producing invocation with no constant pool index or bootstrap method.InvokeInstruction(SSAValue result, InvokeType invokeType, String owner, String name, String descriptor, List<Value> arguments, int originalCpIndex)Creates a value-producing invocation with no bootstrap method.InvokeInstruction(SSAValue result, InvokeType invokeType, String owner, String name, String descriptor, List<Value> arguments, int originalCpIndex, BootstrapMethodInfo bootstrapInfo)Creates a value-producing invocation and registers uses of its SSA arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Taccept(IRVisitor<T> visitor)Accepts a visitor for this instruction.IRInstructioncopyWithNewOperands(SSAValue newResult, List<Value> newOperands)Creates a copy of this instruction with new result and operands.List<Value>getArguments()BootstrapMethodInfogetBootstrapInfo()StringgetDescriptor()InvokeTypegetInvokeType()List<Value>getMethodArguments()Gets the method arguments excluding the receiver.StringgetName()List<Value>getOperands()Gets the operands used by this instruction.intgetOriginalCpIndex()StringgetOwner()ValuegetReceiver()Gets the receiver object for instance method calls.booleanhasBootstrapInfo()Checks if this invocation has bootstrap method info available.booleanisDynamic()Checks if this is an invokedynamic instruction.voidreplaceOperand(Value oldValue, Value newValue)Replaces an operand value with a new value.StringtoString()-
Methods inherited from class com.tonic.analysis.ssa.ir.IRInstruction
equals, getBlock, getBytecodeOffset, getId, getResult, getResultType, hashCode, hasResult, isPhi, isTerminator, replaceTarget, resetIdCounter, setBlock, setBytecodeOffset, setResult
-
-
-
-
Constructor Detail
-
InvokeInstruction
public InvokeInstruction(SSAValue result, InvokeType invokeType, String owner, String name, String descriptor, List<Value> arguments)
Creates a value-producing invocation with no constant pool index or bootstrap method.- Parameters:
result- the SSA value receiving the return valueinvokeType- the dispatch kindowner- the internal name of the declaring classname- the method namedescriptor- the method descriptorarguments- the call arguments, including the receiver for instance calls
-
InvokeInstruction
public InvokeInstruction(SSAValue result, InvokeType invokeType, String owner, String name, String descriptor, List<Value> arguments, int originalCpIndex)
Creates a value-producing invocation with no bootstrap method.- Parameters:
result- the SSA value receiving the return valueinvokeType- the dispatch kindowner- the internal name of the declaring classname- the method namedescriptor- the method descriptorarguments- the call arguments, including the receiver for instance callsoriginalCpIndex- the constant pool index of the original call site, or 0
-
InvokeInstruction
public InvokeInstruction(SSAValue result, InvokeType invokeType, String owner, String name, String descriptor, List<Value> arguments, int originalCpIndex, BootstrapMethodInfo bootstrapInfo)
Creates a value-producing invocation and registers uses of its SSA arguments.- Parameters:
result- the SSA value receiving the return valueinvokeType- the dispatch kindowner- the internal name of the declaring classname- the method namedescriptor- the method descriptorarguments- the call arguments, including the receiver for instance callsoriginalCpIndex- the constant pool index of the original call site, or 0bootstrapInfo- the bootstrap method for invokedynamic, or null
-
InvokeInstruction
public InvokeInstruction(InvokeType invokeType, String owner, String name, String descriptor, List<Value> arguments)
Creates a void invocation with no constant pool index or bootstrap method.- Parameters:
invokeType- the dispatch kindowner- the internal name of the declaring classname- the method namedescriptor- the method descriptorarguments- the call arguments, including the receiver for instance calls
-
InvokeInstruction
public InvokeInstruction(InvokeType invokeType, String owner, String name, String descriptor, List<Value> arguments, int originalCpIndex)
Creates a void invocation with no bootstrap method.- Parameters:
invokeType- the dispatch kindowner- the internal name of the declaring classname- the method namedescriptor- the method descriptorarguments- the call arguments, including the receiver for instance callsoriginalCpIndex- the constant pool index of the original call site, or 0
-
InvokeInstruction
public InvokeInstruction(InvokeType invokeType, String owner, String name, String descriptor, List<Value> arguments, int originalCpIndex, BootstrapMethodInfo bootstrapInfo)
Creates a void invocation and registers uses of its SSA arguments.- Parameters:
invokeType- the dispatch kindowner- the internal name of the declaring classname- the method namedescriptor- the method descriptorarguments- the call arguments, including the receiver for instance callsoriginalCpIndex- the constant pool index of the original call site, or 0bootstrapInfo- the bootstrap method for invokedynamic, or null
-
-
Method Detail
-
getInvokeType
public InvokeType getInvokeType()
- Returns:
- the invoke type
-
getOwner
public String getOwner()
- Returns:
- the owner
-
getName
public String getName()
- Returns:
- the name
-
getDescriptor
public String getDescriptor()
- Returns:
- the descriptor
-
getOriginalCpIndex
public int getOriginalCpIndex()
- Returns:
- the original cp index
-
getBootstrapInfo
public BootstrapMethodInfo getBootstrapInfo()
- Returns:
- the bootstrap info
-
getReceiver
public Value getReceiver()
Gets the receiver object for instance method calls.- Returns:
- the receiver value, or null for static calls
-
getMethodArguments
public List<Value> getMethodArguments()
Gets the method arguments excluding the receiver.- Returns:
- list of method arguments
-
isDynamic
public boolean isDynamic()
Checks if this is an invokedynamic instruction.- Returns:
- true if this is a dynamic invocation
-
hasBootstrapInfo
public boolean hasBootstrapInfo()
Checks if this invocation has bootstrap method info available.- Returns:
- true if bootstrap info is available
-
getOperands
public List<Value> getOperands()
Description copied from class:IRInstructionGets the operands used by this instruction.- Specified by:
getOperandsin classIRInstruction- Returns:
- list of operand values
-
replaceOperand
public void replaceOperand(Value oldValue, Value newValue)
Description copied from class:IRInstructionReplaces an operand value with a new value.- Specified by:
replaceOperandin classIRInstruction- Parameters:
oldValue- the value to replacenewValue- the replacement value
-
accept
public <T> T accept(IRVisitor<T> visitor)
Description copied from class:IRInstructionAccepts a visitor for this instruction.- Specified by:
acceptin classIRInstruction- Type Parameters:
T- the return type- Parameters:
visitor- the visitor to accept- Returns:
- the visitor result
-
copyWithNewOperands
public IRInstruction copyWithNewOperands(SSAValue newResult, List<Value> newOperands)
Description copied from class:IRInstructionCreates a copy of this instruction with new result and operands.- Overrides:
copyWithNewOperandsin classIRInstruction- Parameters:
newResult- the new result value (may be null)newOperands- the new operand values- Returns:
- a copy of this instruction, or null if copying not supported
-
-