Package proguard.evaluation.value
Class InstructionOffsetValue
java.lang.Object
proguard.evaluation.value.Value
proguard.evaluation.value.Category1Value
proguard.evaluation.value.InstructionOffsetValue
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
FieldsModifier and TypeFieldDescriptionstatic final intstatic final InstructionOffsetValuestatic final intstatic final intstatic final intstatic final intstatic final intstatic final intFields 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
ConstructorsConstructorDescriptionInstructionOffsetValue(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
Modifier and TypeMethodDescriptionadd(int value) Returns an InstructionOffsetValue that contains the instructions offsets of this value and the given instruction offset.final intReturns the computational type of this Value.booleancontains(int value) Returns whether the given value is present in this list of instruction offsets.booleanfinal InstructionOffsetValuegeneralize(InstructionOffsetValue other) Returns the generalization of this InstructionOffsetValue and the given other InstructionOffsetValue.final Valuegeneralize(Value other) Returns the generalization of this Value and the given other Value.inthashCode()intinstructionOffset(int index) Returns the specified instruction offset of this value.intReturns the number of instruction offsets of this value.final InstructionOffsetValueReturns this Value as an InstructionOffsetValue.final StringReturns the internal type of this Value.booleanisCast(int index) Returns whether the specified instruction offset corresponds to a cast.booleanisExceptionHandler(int index) Returns whether the specified instruction offset corresponds to an exception handler.booleanisFieldValue(int index) Returns whether the specified instruction offset corresponds to a field value.booleanisMethodParameter(int index) Returns whether the specified instruction offset corresponds to a method parameter.booleanisMethodReturnValue(int index) Returns whether the specified instruction offset corresponds to a method return value.booleanisNewinstance(int index) Returns whether the specified instruction offset corresponds to a new instance.booleanReturns whether this Value represents a single particular (known) value.booleanReturns whether this Value represents a single specific (but possibly unknown) value.intReturns the maximum value from this list of instruction offsets.intmethodParameter(int index) Returns the specified method parameter (assuming it is one).intReturns the minimum value from this list of instruction offsets.booleanoverlaps(int startOffset, int endOffset) Return true if any instruction in the currentInstructionOffsetValueoverlaps with the given instruction range.remove(int value) Returns an InstructionOffsetValue that contains the instructions offsets of this value but not the given instruction offset.toString()Methods inherited from class proguard.evaluation.value.Category1Value
category1Value, isCategory2Methods inherited from class proguard.evaluation.value.Value
category2Value, copyIfMutable, doubleValue, floatValue, integerValue, longValue, referenceValue
-
Field Details
-
EMPTY_VALUE
-
INSTRUCTION_OFFSET_MASK
public static final int INSTRUCTION_OFFSET_MASK- See Also:
-
METHOD_PARAMETER
public static final int METHOD_PARAMETER- See Also:
-
METHOD_RETURN_VALUE
public static final int METHOD_RETURN_VALUE- See Also:
-
FIELD_VALUE
public static final int FIELD_VALUE- See Also:
-
NEW_INSTANCE
public static final int NEW_INSTANCE- See Also:
-
CAST
public static final int CAST- See Also:
-
EXCEPTION_HANDLER
public static final int EXCEPTION_HANDLER- See Also:
-
-
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. ReturnsInteger.MAX_VALUEif the list is empty. -
maximumValue
public int maximumValue()Returns the maximum value from this list of instruction offsets. ReturnsInteger.MIN_VALUEif 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
Returns an InstructionOffsetValue that contains the instructions offsets of this value and the given instruction offset. -
remove
Returns an InstructionOffsetValue that contains the instructions offsets of this value but not the given instruction offset. -
generalize
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 currentInstructionOffsetValueoverlaps with the given instruction range. -
instructionOffsetValue
Description copied from class:ValueReturns this Value as an InstructionOffsetValue.- Overrides:
instructionOffsetValuein classValue
-
isSpecific
public boolean isSpecific()Description copied from class:ValueReturns whether this Value represents a single specific (but possibly unknown) value.- Overrides:
isSpecificin classValue
-
isParticular
public boolean isParticular()Description copied from class:ValueReturns whether this Value represents a single particular (known) value.- Overrides:
isParticularin classValue
-
generalize
Description copied from class:ValueReturns the generalization of this Value and the given other Value.- Specified by:
generalizein classValue
-
computationalType
public final int computationalType()Description copied from class:ValueReturns the computational type of this Value.- Specified by:
computationalTypein classValue- Returns:
TYPE_INTEGER,TYPE_LONG,TYPE_FLOAT,TYPE_DOUBLE,TYPE_REFERENCE, orTYPE_INSTRUCTION_OFFSET.
-
internalType
Description copied from class:ValueReturns the internal type of this Value.- Specified by:
internalTypein 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
-
hashCode
public int hashCode() -
toString
-