edu.umd.cs.findbugs.ba.vna

Class AvailableLoad

public class AvailableLoad extends Object implements 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.

Author: David Hovemeyer

See Also: ValueNumberAnalysis

Constructor Summary
AvailableLoad(StaticField staticField)
Constructor from static field.
AvailableLoad(ValueNumber reference, InstanceField field)
Constructor from object reference and instance field.
Method Summary
intcompareTo(AvailableLoad other)
XFieldgetField()
Get the field for which a load is available.
ValueNumbergetReference()
Get the ValueNumber of the object reference.
booleanmatchesReference(ValueNumber v)

Constructor Detail

AvailableLoad

public AvailableLoad(StaticField staticField)
Constructor from static field.

Parameters: staticField the StaticField

AvailableLoad

public AvailableLoad(ValueNumber reference, InstanceField field)
Constructor from object reference and instance field.

Parameters: reference the ValueNumber of the object reference field the InstanceField

Method Detail

compareTo

public int compareTo(AvailableLoad other)

getField

public XField getField()
Get the field for which a load is available.

Returns: the XField

getReference

public ValueNumber getReference()
Get the ValueNumber of the object reference.

Returns: the ValueNumber, or null if this is a an available static field load

matchesReference

public boolean matchesReference(ValueNumber v)
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.