public class AvailableLoad extends java.lang.Object implements java.lang.Comparable<AvailableLoad>
An AvailableLoad indicates a field and (optionally) object reference for which a value is available. It is used to implement redundant load elimination and forward substitution in ValueNumberAnalysis. The idea is that programmers often reload fields unnecessarily when they "know" that the value will not change. In order to deduce the intended meaning of such code, our analyses need to figure out that such loads return the same value.
AvailableLoad objects may be used as keys in both hash and tree sets and maps.
ValueNumberAnalysis
Constructor and Description |
---|
AvailableLoad(ValueNumber reference,
XField field)
Constructor from object reference and instance field.
|
AvailableLoad(XField staticField)
Constructor from static field.
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(AvailableLoad other) |
boolean |
equals(java.lang.Object o) |
XField |
getField()
Get the field for which a load is available.
|
ValueNumber |
getReference()
Get the ValueNumber of the object reference.
|
int |
hashCode() |
boolean |
matchesReference(ValueNumber v) |
java.lang.String |
toString() |
public AvailableLoad(XField staticField)
staticField
- the StaticFieldpublic AvailableLoad(ValueNumber reference, XField field)
reference
- the ValueNumber of the object referencefield
- the InstanceFieldpublic ValueNumber getReference()
public boolean matchesReference(ValueNumber v)
public XField getField()
public int compareTo(AvailableLoad other)
compareTo
in interface java.lang.Comparable<AvailableLoad>
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
SpotBugs is licensed under the LGPL.