Package edu.umd.cs.findbugs.ba.vna
Class ValueNumber
java.lang.Object
edu.umd.cs.findbugs.ba.vna.ValueNumber
- All Implemented Interfaces:
Comparable<ValueNumber>
A "value number" is a value produced somewhere in a methods. We use value numbers as dataflow values in Frames. When two frame slots have the same value number, then the same value is in both of those slots.
Instances of ValueNumbers produced by the same ValueNumberFactory
are unique, so reference equality may be used to
determine whether or not two value numbers are the same. In general,
ValueNumbers from different factories cannot be compared.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
(package private) static MapCache
<ValueNumber, ValueNumber> static final int
static final int
(package private) final int
Flags representing meta information about the value.(package private) final int
The value number.static final int
static final int
Flag specifying that this value was the return value of a called method.(package private) static int
(package private) static int
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
ValueNumber
(int number) Constructor.private
ValueNumber
(int number, int flags) -
Method Summary
Modifier and TypeMethodDescriptionint
compareTo
(ValueNumber other) static ValueNumber
createValueNumber
(int number) static ValueNumber
createValueNumber
(int number, int flags) boolean
int
getFlags()
int
boolean
hasFlag
(int flag) int
hashCode()
static int
mergeFlags
(int flags1, int flags2) toString()
-
Field Details
-
cache
-
valueNumbersCreated
static int valueNumbersCreated -
valueNumbersReused
static int valueNumbersReused -
number
final int numberThe value number. -
flags
final int flagsFlags representing meta information about the value. When value numbers are merged, their flags should be the flags common to both. -
RETURN_VALUE
public static final int RETURN_VALUEFlag specifying that this value was the return value of a called method.- See Also:
-
ARRAY_VALUE
public static final int ARRAY_VALUE- See Also:
-
CONSTANT_CLASS_OBJECT
public static final int CONSTANT_CLASS_OBJECT- See Also:
-
PHI_NODE
public static final int PHI_NODE- See Also:
-
CONSTANT_VALUE
public static final int CONSTANT_VALUE- See Also:
-
-
Constructor Details
-
ValueNumber
private ValueNumber(int number) Constructor.- Parameters:
number
- the value number
-
ValueNumber
private ValueNumber(int number, int flags)
-
-
Method Details
-
mergeFlags
public static int mergeFlags(int flags1, int flags2) -
createValueNumber
-
createValueNumber
-
getNumber
public int getNumber() -
getFlags
public int getFlags() -
hasFlag
public boolean hasFlag(int flag) -
toString
-
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<ValueNumber>
-