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 classA 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 intprivate Map<AvailableLoad, ValueNumber> private ArrayList<ValueNumber> booleanprivate Map<ValueNumber, AvailableLoad> (package private) static int(package private) static intprivate static final booleanFields inherited from interface ValueNumberAnalysisFeatures
REDUNDANT_LOAD_ELIMINATION, RLE_DEBUG -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAvailableLoad(AvailableLoad availableLoad, ValueNumber[] value) Add an available load.private voidprivate voidvoidcopyFrom(Frame<ValueNumber> other) Make this Frame exactly the same as the one given as a parameter.private StringextractPackageName(String className) booleanfromMatchingFields(ValueNumber v1, ValueNumber v2) booleanfromMatchingLoads(ValueNumber v1, ValueNumber v2) booleanfuzzyMatch(ValueNumber v1, ValueNumber v2) getAvailableLoad(AvailableLoad availableLoad) Look for an available load.private Map<AvailableLoad, ValueNumber> (package private) ValueNumbergetMergedValue(int slot) private Map<ValueNumber, AvailableLoad> private Map<AvailableLoad, ValueNumber> private Map<ValueNumber, AvailableLoad> booleanbooleanhaveMatchingFlags(ValueNumber v1, ValueNumber v2) voidKill all loads.voidkillAllLoads(boolean primitiveOnly) voidvoidKill all loads.private voidkillAvailableLoads(HashSet<AvailableLoad> killMe) voidkillLoadsOf(Set<XField> fieldsToKill) voidkillLoadsOfField(XField field) Kill all loads of given field.voidkillLoadsWithSimilarName(String className, String methodName) (package private) voidmergeAvailableLoadSets(ValueNumberFrame other, ValueNumberFactory factory, MergeTree mergeTree) private static voidremoveAllKeys(ValueNumberFrame.AvailableLoadBiMap map, Iterable<AvailableLoad> removeMe) booleansameAs(Frame<ValueNumber> other) Return true if this stack frame is the same as the one given as a parameter.private voidsetAvailableLoadMap(ValueNumberFrame.AvailableLoadBiMap availableLoadMap) private voidsetMergedLoads(Map<AvailableLoad, ValueNumber> mergedLoads) (package private) voidsetMergedValue(int slot, ValueNumber value) private voidsetPreviouslyKnownAs(Map<ValueNumber, AvailableLoad> previouslyKnownAs) toString()Convert to string.private static StringvalueToString(ValueNumber[] valueNumberList) booleanveryFuzzyMatch(ValueNumber v1, ValueNumber v2) Methods inherited from class 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: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
-
assignAvailableLoadMap
-
assignPreviouslyKnownAs
-
toString
Description copied from class:FrameConvert to string.- Overrides:
toStringin 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: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()
-