Class InstructionOffsetValue


public class InstructionOffsetValue extends Category1Value
Representation of a partially evaluated instruction offset. It can contain 0 or more specific instruction offsets. Each instruction offset can be flagged as an ordinary offset, a method parameter, a method return value, a field value, a new instance value, or an exception handler.
  • Field Details

  • Constructor Details

    • InstructionOffsetValue

      public InstructionOffsetValue(int value)
      Creates a new InstructionOffsetValue with the given instruction offset.
    • InstructionOffsetValue

      public InstructionOffsetValue(int[] values)
      Creates a new InstructionOffsetValue with the given list of instruction offsets.
  • Method Details

    • instructionOffsetCount

      public int instructionOffsetCount()
      Returns the number of instruction offsets of this value.
    • instructionOffset

      public int instructionOffset(int index)
      Returns the specified instruction offset of this value.
    • contains

      public boolean contains(int value)
      Returns whether the given value is present in this list of instruction offsets.
    • minimumValue

      public int minimumValue()
      Returns the minimum value from this list of instruction offsets. Returns Integer.MAX_VALUE if the list is empty.
    • maximumValue

      public int maximumValue()
      Returns the maximum value from this list of instruction offsets. Returns Integer.MIN_VALUE if the list is empty.
    • isMethodParameter

      public boolean isMethodParameter(int index)
      Returns whether the specified instruction offset corresponds to a method parameter.
    • methodParameter

      public int methodParameter(int index)
      Returns the specified method parameter (assuming it is one).
    • isMethodReturnValue

      public boolean isMethodReturnValue(int index)
      Returns whether the specified instruction offset corresponds to a method return value.
    • isFieldValue

      public boolean isFieldValue(int index)
      Returns whether the specified instruction offset corresponds to a field value.
    • isNewinstance

      public boolean isNewinstance(int index)
      Returns whether the specified instruction offset corresponds to a new instance.
    • isCast

      public boolean isCast(int index)
      Returns whether the specified instruction offset corresponds to a cast.
    • isExceptionHandler

      public boolean isExceptionHandler(int index)
      Returns whether the specified instruction offset corresponds to an exception handler.
    • add

      public InstructionOffsetValue add(int value)
      Returns an InstructionOffsetValue that contains the instructions offsets of this value and the given instruction offset.
    • remove

      public InstructionOffsetValue remove(int value)
      Returns an InstructionOffsetValue that contains the instructions offsets of this value but not the given instruction offset.
    • generalize

      public final InstructionOffsetValue generalize(InstructionOffsetValue other)
      Returns the generalization of this InstructionOffsetValue and the given other InstructionOffsetValue. The values of the other InstructionOffsetValue are guaranteed to remain at the end of the list, in the same order.
    • overlaps

      public boolean overlaps(int startOffset, int endOffset)
      Return true if any instruction in the current InstructionOffsetValue overlaps with the given instruction range.
    • instructionOffsetValue

      public final InstructionOffsetValue instructionOffsetValue()
      Description copied from class: Value
      Returns this Value as an InstructionOffsetValue.
      Overrides:
      instructionOffsetValue in class Value
    • isSpecific

      public boolean isSpecific()
      Description copied from class: Value
      Returns whether this Value represents a single specific (but possibly unknown) value.
      Overrides:
      isSpecific in class Value
    • isParticular

      public boolean isParticular()
      Description copied from class: Value
      Returns whether this Value represents a single particular (known) value.
      Overrides:
      isParticular in class Value
    • generalize

      public final Value generalize(Value other)
      Description copied from class: Value
      Returns the generalization of this Value and the given other Value.
      Specified by:
      generalize in class Value
    • computationalType

      public final int computationalType()
      Description copied from class: Value
      Returns the computational type of this Value.
      Specified by:
      computationalType in class Value
      Returns:
      TYPE_INTEGER, TYPE_LONG, TYPE_FLOAT, TYPE_DOUBLE, TYPE_REFERENCE, or TYPE_INSTRUCTION_OFFSET.
    • internalType

      public final String internalType()
      Description copied from class: Value
      Returns the internal type of this Value.
      Specified by:
      internalType in class Value
      Returns:
      TypeConstants.BOOLEAN, TypeConstants.BYTE, TypeConstants.CHAR, TypeConstants.SHORT, TypeConstants.INT , TypeConstants.LONG, TypeConstants.FLOAT, TypeConstants.DOUBLE, TypeConstants.CLASS_START ... TypeConstants.CLASS_END , or an array type containing any of these types (always as String).
    • equals

      public boolean equals(Object object)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object