Package com.tonic.analysis.instruction
Class InvokeStaticInstruction
- java.lang.Object
-
- com.tonic.analysis.instruction.Instruction
-
- com.tonic.analysis.instruction.InvokeStaticInstruction
-
- All Implemented Interfaces:
InvokeInsn
public class InvokeStaticInstruction extends Instruction implements InvokeInsn
Represents the INVOKESTATIC instruction (0xB8).
-
-
Constructor Summary
Constructors Constructor Description InvokeStaticInstruction(ConstPool constPool, int opcode, int offset, int methodIndex)Constructs an InvokeStaticInstruction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(AbstractBytecodeVisitor visitor)Accepts a visitor for bytecode analysis.intgetLocalChange()Returns the change in local variables caused by this instruction.StringgetMethodDescriptor()Returns the method descriptor.intgetMethodIndex()StringgetMethodName()Returns the method name.StringgetOwnerClass()Returns the owner class name.intgetStackChange()Returns the change in stack size caused by this instruction.StringresolveMethod()Resolves and returns a string representation of the method.StringtoString()Returns a string representation of the instruction.voidwrite(DataOutputStream dos)Writes the INVOKESTATIC opcode and its operand to the DataOutputStream.-
Methods inherited from class com.tonic.analysis.instruction.Instruction
getLength, getOffset, getOpcode, setOffset
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.tonic.analysis.instruction.InvokeInsn
isInterface, isStatic
-
-
-
-
Constructor Detail
-
InvokeStaticInstruction
public InvokeStaticInstruction(ConstPool constPool, int opcode, int offset, int methodIndex)
Constructs an InvokeStaticInstruction.- Parameters:
constPool- The constant pool associated with the class.opcode- The opcode of the instruction.offset- The bytecode offset of the instruction.methodIndex- The constant pool index for the method reference.
-
-
Method Detail
-
getMethodIndex
public int getMethodIndex()
- Returns:
- the method index
-
accept
public void accept(AbstractBytecodeVisitor visitor)
Description copied from class:InstructionAccepts a visitor for bytecode analysis.- Specified by:
acceptin classInstruction- Parameters:
visitor- The visitor to accept.
-
write
public void write(DataOutputStream dos) throws IOException
Writes the INVOKESTATIC opcode and its operand to the DataOutputStream.- Specified by:
writein classInstruction- Parameters:
dos- The DataOutputStream to write to.- Throws:
IOException- If an I/O error occurs.
-
getStackChange
public int getStackChange()
Returns the change in stack size caused by this instruction.- Specified by:
getStackChangein classInstruction- Returns:
- The stack size change (depends on method signature).
-
getLocalChange
public int getLocalChange()
Returns the change in local variables caused by this instruction.- Specified by:
getLocalChangein classInstruction- Returns:
- The local variables size change (none).
-
resolveMethod
public String resolveMethod()
Resolves and returns a string representation of the method.- Returns:
- The method as a string.
-
getMethodName
public String getMethodName()
Returns the method name.- Specified by:
getMethodNamein interfaceInvokeInsn- Returns:
- The method name.
-
getMethodDescriptor
public String getMethodDescriptor()
Returns the method descriptor.- Specified by:
getMethodDescriptorin interfaceInvokeInsn- Returns:
- The method descriptor.
-
getOwnerClass
public String getOwnerClass()
Returns the owner class name.- Specified by:
getOwnerClassin interfaceInvokeInsn- Returns:
- The owner class internal name.
-
toString
public String toString()
Returns a string representation of the instruction.- Overrides:
toStringin classInstruction- Returns:
- The mnemonic, method index, and resolved method.
-
-