Package edu.umd.cs.findbugs.ba.vna
Class ValueNumber
- java.lang.Object
-
- edu.umd.cs.findbugs.ba.vna.ValueNumber
-
- All Implemented Interfaces:
java.lang.Comparable<ValueNumber>
public class ValueNumber extends java.lang.Object implements java.lang.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
ValueNumberFactoryare 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:
ValueNumberAnalysis
-
-
Field Summary
Fields Modifier and Type Field Description static intARRAY_VALUE(package private) static MapCache<ValueNumber,ValueNumber>cachestatic intCONSTANT_CLASS_OBJECTstatic intCONSTANT_VALUE(package private) intflagsFlags representing meta information about the value.(package private) intnumberThe value number.static intPHI_NODEstatic intRETURN_VALUEFlag specifying that this value was the return value of a called method.(package private) static intvalueNumbersCreated(package private) static intvalueNumbersReused
-
Constructor Summary
Constructors Modifier Constructor Description privateValueNumber(int number, int flags)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(ValueNumber other)static ValueNumbercreateValueNumber(int number)static ValueNumbercreateValueNumber(int number, int flags)booleanequals(java.lang.Object o)intgetFlags()intgetNumber()booleanhasFlag(int flag)inthashCode()static intmergeFlags(int flags1, int flags2)java.lang.StringtoString()
-
-
-
Field Detail
-
cache
static MapCache<ValueNumber,ValueNumber> cache
-
valueNumbersCreated
static int valueNumbersCreated
-
valueNumbersReused
static int valueNumbersReused
-
number
final int number
The value number.
-
flags
final int flags
Flags 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_VALUE
Flag specifying that this value was the return value of a called method.- See Also:
- Constant Field Values
-
ARRAY_VALUE
public static final int ARRAY_VALUE
- See Also:
- Constant Field Values
-
CONSTANT_CLASS_OBJECT
public static final int CONSTANT_CLASS_OBJECT
- See Also:
- Constant Field Values
-
PHI_NODE
public static final int PHI_NODE
- See Also:
- Constant Field Values
-
CONSTANT_VALUE
public static final int CONSTANT_VALUE
- See Also:
- Constant Field Values
-
-
Method Detail
-
mergeFlags
public static int mergeFlags(int flags1, int flags2)
-
createValueNumber
public static ValueNumber createValueNumber(int number, int flags)
-
createValueNumber
public static ValueNumber createValueNumber(int number)
-
getNumber
public int getNumber()
-
getFlags
public int getFlags()
-
hasFlag
public boolean hasFlag(int flag)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
compareTo
public int compareTo(ValueNumber other)
- Specified by:
compareToin interfacejava.lang.Comparable<ValueNumber>
-
-