Class NewInstruction

java.lang.Object
com.ibm.wala.shrike.shrikeBT.Instruction
com.ibm.wala.shrike.shrikeBT.NewInstruction
All Implemented Interfaces:
Constants, IInstruction, Cloneable

public final class NewInstruction extends Instruction
  • Method Details

    • make

      public static NewInstruction make(String type, int arrayBoundsCount) throws IllegalArgumentException
      Parameters:
      type - the type of the object that will be returned (in JVM format, e.g., [Ljava/lang/String;)
      arrayBoundsCount - the number of array dimensions to preconstruct (equal to the number of integer parameters this instruction expects)
      Throws:
      IllegalArgumentException - if type is null
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • getArrayBoundsCount

      public int getArrayBoundsCount()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getPoppedCount

      public int getPoppedCount()
      Specified by:
      getPoppedCount in interface IInstruction
      Overrides:
      getPoppedCount in class Instruction
      Returns:
      the number of values this instruction pops off the working stack
    • getPushedType

      public String getPushedType(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 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.
    • getType

      public String getType()
    • toString

      public String toString()
      Description copied from class: Instruction
      Subclasses must implement toString.
      Specified by:
      toString in interface IInstruction
      Specified by:
      toString in class Instruction
    • visit

      public void visit(IInstruction.Visitor v) throws IllegalArgumentException
      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:
      IllegalArgumentException
    • isPEI

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