Package proguard.evaluation.value
Class InstructionOffsetValue
- java.lang.Object
-
- proguard.evaluation.value.Value
-
- proguard.evaluation.value.Category1Value
-
- proguard.evaluation.value.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 Summary
Fields Modifier and Type Field Description static int
CAST
static InstructionOffsetValue
EMPTY_VALUE
static int
EXCEPTION_HANDLER
static int
FIELD_VALUE
static int
INSTRUCTION_OFFSET_MASK
static int
METHOD_PARAMETER
static int
METHOD_RETURN_VALUE
static int
NEW_INSTANCE
-
Fields inherited from class proguard.evaluation.value.Value
ALWAYS, MAYBE, NEVER, TYPE_DOUBLE, TYPE_FLOAT, TYPE_INSTRUCTION_OFFSET, TYPE_INTEGER, TYPE_LONG, TYPE_REFERENCE, TYPE_TOP, TYPE_UNKNOWN
-
-
Constructor Summary
Constructors Constructor Description InstructionOffsetValue(int value)
Creates a new InstructionOffsetValue with the given instruction offset.InstructionOffsetValue(int[] values)
Creates a new InstructionOffsetValue with the given list of instruction offsets.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description InstructionOffsetValue
add(int value)
Returns an InstructionOffsetValue that contains the instructions offsets of this value and the given instruction offset.int
computationalType()
Returns the computational type of this Value.boolean
contains(int value)
Returns whether the given value is present in this list of instruction offsets.boolean
equals(java.lang.Object object)
InstructionOffsetValue
generalize(InstructionOffsetValue other)
Returns the generalization of this InstructionOffsetValue and the given other InstructionOffsetValue.Value
generalize(Value other)
Returns the generalization of this Value and the given other Value.int
hashCode()
int
instructionOffset(int index)
Returns the specified instruction offset of this value.int
instructionOffsetCount()
Returns the number of instruction offsets of this value.InstructionOffsetValue
instructionOffsetValue()
Returns this Value as an InstructionOffsetValue.java.lang.String
internalType()
Returns the internal type of this Value.boolean
isCast(int index)
Returns whether the specified instruction offset corresponds to a cast.boolean
isExceptionHandler(int index)
Returns whether the specified instruction offset corresponds to an exception handler.boolean
isFieldValue(int index)
Returns whether the specified instruction offset corresponds to a field value.boolean
isMethodParameter(int index)
Returns whether the specified instruction offset corresponds to a method parameter.boolean
isMethodReturnValue(int index)
Returns whether the specified instruction offset corresponds to a method return value.boolean
isNewinstance(int index)
Returns whether the specified instruction offset corresponds to a new instance.boolean
isParticular()
Returns whether this Value represents a single particular (known) value.boolean
isSpecific()
Returns whether this Value represents a single specific (but possibly unknown) value.int
maximumValue()
Returns the maximum value from this list of instruction offsets.int
methodParameter(int index)
Returns the specified method parameter (assuming it is one).int
minimumValue()
Returns the minimum value from this list of instruction offsets.InstructionOffsetValue
remove(int value)
Returns an InstructionOffsetValue that contains the instructions offsets of this value but not the given instruction offset.java.lang.String
toString()
-
Methods inherited from class proguard.evaluation.value.Category1Value
category1Value, isCategory2
-
Methods inherited from class proguard.evaluation.value.Value
category2Value, copyIfMutable, doubleValue, floatValue, integerValue, longValue, referenceValue
-
-
-
-
Field Detail
-
EMPTY_VALUE
public static final InstructionOffsetValue EMPTY_VALUE
-
INSTRUCTION_OFFSET_MASK
public static final int INSTRUCTION_OFFSET_MASK
- See Also:
- Constant Field Values
-
METHOD_PARAMETER
public static final int METHOD_PARAMETER
- See Also:
- Constant Field Values
-
METHOD_RETURN_VALUE
public static final int METHOD_RETURN_VALUE
- See Also:
- Constant Field Values
-
FIELD_VALUE
public static final int FIELD_VALUE
- See Also:
- Constant Field Values
-
NEW_INSTANCE
public static final int NEW_INSTANCE
- See Also:
- Constant Field Values
-
CAST
public static final int CAST
- See Also:
- Constant Field Values
-
EXCEPTION_HANDLER
public static final int EXCEPTION_HANDLER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
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 Detail
-
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. ReturnsInteger.MAX_VALUE
if the list is empty.
-
maximumValue
public int maximumValue()
Returns the maximum value from this list of instruction offsets. ReturnsInteger.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.
-
instructionOffsetValue
public final InstructionOffsetValue instructionOffsetValue()
Description copied from class:Value
Returns this Value as an InstructionOffsetValue.- Overrides:
instructionOffsetValue
in classValue
-
isSpecific
public boolean isSpecific()
Description copied from class:Value
Returns whether this Value represents a single specific (but possibly unknown) value.- Overrides:
isSpecific
in classValue
-
isParticular
public boolean isParticular()
Description copied from class:Value
Returns whether this Value represents a single particular (known) value.- Overrides:
isParticular
in classValue
-
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 classValue
-
computationalType
public final int computationalType()
Description copied from class:Value
Returns the computational type of this Value.- Specified by:
computationalType
in classValue
- Returns:
TYPE_INTEGER
,TYPE_LONG
,TYPE_FLOAT
,TYPE_DOUBLE
,TYPE_REFERENCE
, orTYPE_INSTRUCTION_OFFSET
.
-
internalType
public final java.lang.String internalType()
Description copied from class:Value
Returns the internal type of this Value.- Specified by:
internalType
in classValue
- 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(java.lang.Object object)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-