Package com.tonic.analysis.instruction
Class WideIIncInstruction
- java.lang.Object
-
- com.tonic.analysis.instruction.Instruction
-
- com.tonic.analysis.instruction.WideIIncInstruction
-
- All Implemented Interfaces:
LocalVarInstruction
public class WideIIncInstruction extends Instruction implements LocalVarInstruction
Represents the JVM WIDE IINC instruction.
-
-
Constructor Summary
Constructors Constructor Description WideIIncInstruction(int opcode, int offset, int varIndex, int constValue)Constructs a WideIIncInstruction.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(AbstractBytecodeVisitor visitor)Accepts a visitor for bytecode analysis.intgetConstValue()Returns the constant value by which the local variable is incremented.intgetLocalChange()Returns the change in local variables caused by this instruction.intgetStackChange()Returns the change in stack size caused by this instruction.intgetVarIndex()Returns the local variable index to be incremented.StringtoString()Returns a string representation of the instruction.voidwrite(DataOutputStream dos)Writes the WIDE IINC opcode and its operands to the DataOutputStream.-
Methods inherited from class com.tonic.analysis.instruction.Instruction
getLength, getOffset, getOpcode, setOffset
-
-
-
-
Constructor Detail
-
WideIIncInstruction
public WideIIncInstruction(int opcode, int offset, int varIndex, int constValue)Constructs a WideIIncInstruction.- Parameters:
opcode- The WIDE opcode (0xC4).offset- The bytecode offset where WIDE starts.varIndex- The two-byte local variable index.constValue- The two-byte constant increment.
-
-
Method Detail
-
getVarIndex
public int getVarIndex()
Returns the local variable index to be incremented.- Specified by:
getVarIndexin interfaceLocalVarInstruction- Returns:
- The variable index.
-
getConstValue
public int getConstValue()
Returns the constant value by which the local variable is incremented.- Returns:
- The constant increment value.
-
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 WIDE IINC opcode and its operands 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 (none).
-
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).
-
toString
public String toString()
Returns a string representation of the instruction.- Overrides:
toStringin classInstruction- Returns:
- The instruction details.
-
-