Package edu.umd.cs.findbugs.ba.vna
Class ValueNumberFrame
- All Implemented Interfaces:
ValueNumberAnalysisFeatures
A dataflow value representing a Java stack frame with value number
information.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static class
A wrapper for the AvailableLoad to ValueNumber[] map also keeping track of a reverse map. -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static int
(package private) static int
(package private) static int
private Map
<AvailableLoad, ValueNumber> private ArrayList
<ValueNumber> boolean
private Map
<ValueNumber, AvailableLoad> (package private) static int
(package private) static int
private static final boolean
Fields inherited from interface edu.umd.cs.findbugs.ba.vna.ValueNumberAnalysisFeatures
REDUNDANT_LOAD_ELIMINATION, RLE_DEBUG
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addAvailableLoad
(AvailableLoad availableLoad, ValueNumber[] value) Add an available load.private void
private void
void
copyFrom
(Frame<ValueNumber> other) Make this Frame exactly the same as the one given as a parameter.private String
extractPackageName
(String className) boolean
fromMatchingFields
(ValueNumber v1, ValueNumber v2) boolean
fromMatchingLoads
(ValueNumber v1, ValueNumber v2) boolean
fuzzyMatch
(ValueNumber v1, ValueNumber v2) getAvailableLoad
(AvailableLoad availableLoad) Look for an available load.private Map
<AvailableLoad, ValueNumber> (package private) ValueNumber
getMergedValue
(int slot) private Map
<ValueNumber, AvailableLoad> private Map
<AvailableLoad, ValueNumber> private Map
<ValueNumber, AvailableLoad> boolean
boolean
haveMatchingFlags
(ValueNumber v1, ValueNumber v2) void
Kill all loads.void
killAllLoads
(boolean primitiveOnly) void
void
Kill all loads.private void
killAvailableLoads
(HashSet<AvailableLoad> killMe) void
killLoadsOf
(Set<XField> fieldsToKill) void
killLoadsOfField
(XField field) Kill all loads of given field.void
killLoadsWithSimilarName
(String className, String methodName) (package private) void
mergeAvailableLoadSets
(ValueNumberFrame other, ValueNumberFactory factory, MergeTree mergeTree) private static void
removeAllKeys
(ValueNumberFrame.AvailableLoadBiMap map, Iterable<AvailableLoad> removeMe) boolean
sameAs
(Frame<ValueNumber> other) Return true if this stack frame is the same as the one given as a parameter.private void
setAvailableLoadMap
(ValueNumberFrame.AvailableLoadBiMap availableLoadMap) private void
setMergedLoads
(Map<AvailableLoad, ValueNumber> mergedLoads) (package private) void
setMergedValue
(int slot, ValueNumber value) private void
setPreviouslyKnownAs
(Map<ValueNumber, AvailableLoad> previouslyKnownAs) toString()
Convert to string.private static String
valueToString
(ValueNumber[] valueNumberList) boolean
veryFuzzyMatch
(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
-
Field Details
-
mergedValueList
-
availableLoadMap
-
mergedLoads
-
previouslyKnownAs
-
phiNodeForLoads
public boolean phiNodeForLoads -
USE_WRITTEN_OUTSIDE_OF_CONSTRUCTOR
private static final boolean USE_WRITTEN_OUTSIDE_OF_CONSTRUCTOR- See Also:
-
constructedUnmodifiableMap
static int constructedUnmodifiableMap -
reusedMap
static int reusedMap -
createdEmptyMap
static int createdEmptyMap -
madeImmutableMutable
static int madeImmutableMutable -
reusedMutableMap
static int reusedMutableMap
-
-
Constructor Details
-
ValueNumberFrame
public ValueNumberFrame(int numLocals)
-
-
Method Details
-
availableLoadMapAsString
-
getLoad
-
getAvailableLoad
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
Add an available load.- Parameters:
availableLoad
- the AvailableLoad (reference and field)value
- the value(s) loaded
-
removeAllKeys
private static void removeAllKeys(ValueNumberFrame.AvailableLoadBiMap map, Iterable<AvailableLoad> removeMe) -
killLoadsOfField
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
-
killAllLoadsOf
Kill all loads. This conservatively handles method calls where we don't really know what fields might be assigned. -
killLoadsOf
-
killLoadsWithSimilarName
-
killAvailableLoads
-
extractPackageName
-
mergeAvailableLoadSets
void mergeAvailableLoadSets(ValueNumberFrame other, ValueNumberFactory factory, MergeTree mergeTree) -
getMergedValue
-
setMergedValue
-
copyFrom
Description copied from class:Frame
Make this Frame exactly the same as the one given as a parameter.- Overrides:
copyFrom
in classFrame<ValueNumber>
- Parameters:
other
- the Frame to make this object the same as
-
assignAvailableLoadMap
-
assignPreviouslyKnownAs
-
toString
Description copied from class:Frame
Convert to string.- Overrides:
toString
in classFrame<ValueNumber>
-
valueToString
-
fuzzyMatch
-
veryFuzzyMatch
-
fromMatchingLoads
-
fromMatchingFields
-
haveMatchingFlags
- Returns:
- true if v1 and v2 have a flag in common
-
valueNumbersForLoads
-
setAvailableLoadMap
-
getAvailableLoadMap
-
getUpdateableAvailableLoadMap
-
setMergedLoads
-
getMergedLoads
-
getUpdateableMergedLoads
-
setPreviouslyKnownAs
-
getPreviouslyKnownAs
-
getUpdateablePreviouslyKnownAs
-
sameAs
Description copied from class:Frame
Return true if this stack frame is the same as the one given as a parameter.- Overrides:
sameAs
in classFrame<ValueNumber>
- Parameters:
other
- the other Frame- Returns:
- true if the frames are the same, false otherwise
-
hasAvailableLoads
public boolean hasAvailableLoads()
-