Package com.tonic.analysis.instruction
Class ArithmeticShiftInstruction
- java.lang.Object
-
- com.tonic.analysis.instruction.Instruction
-
- com.tonic.analysis.instruction.ArithmeticShiftInstruction
-
public class ArithmeticShiftInstruction extends Instruction
Represents shift instructions (ISHL, LSHL, ISHR, LSHR, IUSHR, LUSHR).
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classArithmeticShiftInstruction.ShiftTypeThe shift operation kinds, each pairing a JVM opcode with its mnemonic.
-
Constructor Summary
Constructors Constructor Description ArithmeticShiftInstruction(int opcode, int offset)Constructs an ArithmeticShiftInstruction.
-
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.intgetStackChange()Returns the change in stack size caused by this instruction.ArithmeticShiftInstruction.ShiftTypegetType()StringtoString()voidwrite(DataOutputStream dos)Writes the instruction to the DataOutputStream.-
Methods inherited from class com.tonic.analysis.instruction.Instruction
getLength, getOffset, getOpcode, setOffset
-
-
-
-
Constructor Detail
-
ArithmeticShiftInstruction
public ArithmeticShiftInstruction(int opcode, int offset)Constructs an ArithmeticShiftInstruction.- Parameters:
opcode- The opcode of the instruction.offset- The bytecode offset of the instruction.- Throws:
IllegalArgumentException- if the opcode is not a shift opcode
-
-
Method Detail
-
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
Description copied from class:InstructionWrites the instruction 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()
Description copied from class:InstructionReturns the change in stack size caused by this instruction.- Specified by:
getStackChangein classInstruction- Returns:
- The stack size change.
-
getLocalChange
public int getLocalChange()
Description copied from class:InstructionReturns the change in local variables caused by this instruction.- Specified by:
getLocalChangein classInstruction- Returns:
- The local variables size change.
-
getType
public ArithmeticShiftInstruction.ShiftType getType()
- Returns:
- the type
-
toString
public String toString()
- Overrides:
toStringin classInstruction
-
-