Package com.tonic.analysis.instruction
Class DConstInstruction
- java.lang.Object
-
- com.tonic.analysis.instruction.Instruction
-
- com.tonic.analysis.instruction.DConstInstruction
-
public class DConstInstruction extends Instruction
Represents the JVM DCONST_0 and DCONST_1 instructions.
-
-
Constructor Summary
Constructors Constructor Description DConstInstruction(int opcode, int offset, double value)Constructs a DConstInstruction.
-
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.doublegetValue()Returns the constant value pushed onto the stack.StringtoString()Returns a string representation of the instruction.voidwrite(DataOutputStream dos)Writes the DCONST_* opcode to the DataOutputStream.-
Methods inherited from class com.tonic.analysis.instruction.Instruction
getLength, getOffset, getOpcode, setOffset
-
-
-
-
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
Writes the DCONST_* opcode 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 (pushes a double, which occupies two stack slots).
-
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).
-
getValue
public double getValue()
Returns the constant value pushed onto the stack.- Returns:
- The double constant.
-
toString
public String toString()
Returns a string representation of the instruction.- Overrides:
toStringin classInstruction- Returns:
- The mnemonic and value of the instruction.
-
-