Package edu.umd.cs.findbugs.ba.vna
Class ValueNumberFrame
- java.lang.Object
-
- edu.umd.cs.findbugs.ba.Frame<ValueNumber>
-
- edu.umd.cs.findbugs.ba.vna.ValueNumberFrame
-
- All Implemented Interfaces:
ValueNumberAnalysisFeatures
public class ValueNumberFrame extends Frame<ValueNumber> implements ValueNumberAnalysisFeatures
A dataflow value representing a Java stack frame with value number information.- Author:
- David Hovemeyer
- See Also:
ValueNumber,ValueNumberAnalysis
-
-
Field Summary
Fields Modifier and Type Field Description booleanphiNodeForLoads-
Fields inherited from interface edu.umd.cs.findbugs.ba.vna.ValueNumberAnalysisFeatures
REDUNDANT_LOAD_ELIMINATION, RLE_DEBUG
-
-
Constructor Summary
Constructors Constructor Description ValueNumberFrame(int numLocals)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAvailableLoad(AvailableLoad availableLoad, ValueNumber[] value)Add an available load.java.lang.StringavailableLoadMapAsString()voidcopyFrom(Frame<ValueNumber> other)Make this Frame exactly the same as the one given as a parameter.booleanfromMatchingFields(ValueNumber v1, ValueNumber v2)booleanfromMatchingLoads(ValueNumber v1, ValueNumber v2)booleanfuzzyMatch(ValueNumber v1, ValueNumber v2)ValueNumber[]getAvailableLoad(AvailableLoad availableLoad)Look for an available load.AvailableLoadgetLoad(ValueNumber v)booleanhasAvailableLoads()booleanhaveMatchingFlags(ValueNumber v1, ValueNumber v2)voidkillAllLoads()Kill all loads.voidkillAllLoads(boolean primitiveOnly)voidkillAllLoadsExceptFor(ValueNumber v)voidkillAllLoadsOf(ValueNumber v)Kill all loads.voidkillLoadsOf(java.util.Set<XField> fieldsToKill)voidkillLoadsOfField(XField field)Kill all loads of given field.voidkillLoadsWithSimilarName(java.lang.String className, java.lang.String methodName)booleansameAs(Frame<ValueNumber> other)Return true if this stack frame is the same as the one given as a parameter.java.lang.StringtoString()Convert to string.java.util.Collection<ValueNumber>valueNumbersForLoads()booleanveryFuzzyMatch(ValueNumber v1, ValueNumber v2)-
Methods inherited from class edu.umd.cs.findbugs.ba.Frame
allSlots, clearStack, contains, getArgument, getArgument, getArgumentSet, getArgumentSlot, getInstance, getInstanceSlot, getInstanceStackLocation, getLastUpdateTimestamp, getNumArguments, getNumArgumentsIncludingObjectInstance, getNumLocals, getNumSlots, getOperand, getStackDepth, getStackLocation, getStackValue, getTopStackWords, getTopValue, getValue, isBottom, isTop, isValid, popValue, pushValue, setBottom, setLastUpdateTimestamp, setTop, setValid, setValue, valueToString
-
-
-
-
Method Detail
-
availableLoadMapAsString
public java.lang.String availableLoadMapAsString()
-
getLoad
@CheckForNull public AvailableLoad getLoad(ValueNumber v)
-
getAvailableLoad
public ValueNumber[] getAvailableLoad(AvailableLoad availableLoad)
Look for an available load.- Parameters:
availableLoad- the AvailableLoad (reference and field)- Returns:
- the value(s) available, or null if no matching entry is found
-
addAvailableLoad
public void addAvailableLoad(AvailableLoad availableLoad, @Nonnull ValueNumber[] value)
Add an available load.- Parameters:
availableLoad- the AvailableLoad (reference and field)value- the value(s) loaded
-
killLoadsOfField
public void killLoadsOfField(XField field)
Kill all loads of given field.- Parameters:
field- the field
-
killAllLoads
public void killAllLoads()
Kill all loads. This conservatively handles method calls where we don't really know what fields might be assigned.
-
killAllLoads
public void killAllLoads(boolean primitiveOnly)
-
killAllLoadsExceptFor
public void killAllLoadsExceptFor(@CheckForNull ValueNumber v)
-
killAllLoadsOf
public void killAllLoadsOf(@CheckForNull ValueNumber v)Kill all loads. This conservatively handles method calls where we don't really know what fields might be assigned.
-
killLoadsOf
public void killLoadsOf(java.util.Set<XField> fieldsToKill)
-
killLoadsWithSimilarName
public void killLoadsWithSimilarName(java.lang.String className, java.lang.String methodName)
-
copyFrom
public void copyFrom(Frame<ValueNumber> other)
Description copied from class:FrameMake this Frame exactly the same as the one given as a parameter.- Overrides:
copyFromin classFrame<ValueNumber>- Parameters:
other- the Frame to make this object the same as
-
toString
public java.lang.String toString()
Description copied from class:FrameConvert to string.- Overrides:
toStringin classFrame<ValueNumber>
-
fuzzyMatch
public boolean fuzzyMatch(ValueNumber v1, ValueNumber v2)
-
veryFuzzyMatch
public boolean veryFuzzyMatch(ValueNumber v1, ValueNumber v2)
-
fromMatchingLoads
public boolean fromMatchingLoads(ValueNumber v1, ValueNumber v2)
-
fromMatchingFields
public boolean fromMatchingFields(ValueNumber v1, ValueNumber v2)
-
haveMatchingFlags
public boolean haveMatchingFlags(ValueNumber v1, ValueNumber v2)
- Returns:
- true if v1 and v2 have a flag in common
-
valueNumbersForLoads
public java.util.Collection<ValueNumber> valueNumbersForLoads()
-
sameAs
public boolean sameAs(Frame<ValueNumber> other)
Description copied from class:FrameReturn true if this stack frame is the same as the one given as a parameter.- Overrides:
sameAsin classFrame<ValueNumber>- Parameters:
other- the other Frame- Returns:
- true if the frames are the same, false otherwise
-
hasAvailableLoads
public boolean hasAvailableLoads()
-
-