Class ConstantInstruction

  • All Implemented Interfaces:
    Constants, IInstruction, java.lang.Cloneable

    public abstract class ConstantInstruction
    extends Instruction
    A ConstantInstruction pushes some constant value onto the stack.
    • Constructor Detail

      • ConstantInstruction

        public ConstantInstruction​(short opcode)
    • Method Detail

      • getValue

        public abstract java.lang.Object getValue()
        Returns:
        the constant value pushed: an Integer, a Long, a Float, a Double, a String, or null
      • getType

        public abstract java.lang.String getType()
        Returns:
        the type of the value pushed
      • make

        public static ConstantInstruction make​(java.lang.String type,
                                               java.lang.Object constant)
                                        throws java.lang.IllegalArgumentException
        Throws:
        java.lang.IllegalArgumentException
      • equals

        public final boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • getPushedType

        public final java.lang.String getPushedType​(java.lang.String[] types)
        Description copied from class: Instruction
        Computes the type of data pushed onto the stack, or null if none is pushed.
        Specified by:
        getPushedType in interface IInstruction
        Overrides:
        getPushedType in class Instruction
        Parameters:
        types - the types of the data popped off the stack by this instruction; if poppedTypes is null, then we don't know the incoming stack types and the result of this method may be less accurate
      • getPushedWordSize

        public final byte getPushedWordSize()
        Specified by:
        getPushedWordSize in interface IInstruction
        Overrides:
        getPushedWordSize in class Instruction
        Returns:
        the JVM word size of the value this instruction pushes onto the stack, or 0 if this instruction doesn't push anything onto the stack.
      • hashCode

        public final int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • visit

        public final void visit​(IInstruction.Visitor v)
                         throws java.lang.NullPointerException
        Description copied from class: Instruction
        Apply a Visitor to this instruction. We invoke the appropriate Visitor method according to the type of this instruction.
        Specified by:
        visit in interface IInstruction
        Specified by:
        visit in class Instruction
        Throws:
        java.lang.NullPointerException
      • isPEI

        public boolean isPEI()
        Description copied from interface: IInstruction
        PEI == "Potentially excepting instruction"
        Returns:
        true iff this instruction might throw an exception