Class ZeroXInstanceKeys
java.lang.Object
com.ibm.wala.ipa.callgraph.propagation.cfa.ZeroXInstanceKeys
- All Implemented Interfaces:
InstanceKeyFactory
Flexible class to create
InstanceKey
s depending on various policies ranging from
class-based (i.e. 0-CFA) to allocation-site-based (0-1-CFA variants).-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
An ALLOCATIONS - based policy distinguishes instances by allocation site.static final int
Should we use constant-specific keys?static final TypeReference
static final TypeReference
static final TypeReference
static final int
The NONE policy is not allocation-site basedstatic final int
This variant counts the N, number of allocation sites of a particular type T in each method.static final int
A policy variant where if a type T has only primitive instance fields, then instances of type T are NOT disambiguated by allocation site.static final int
A policy variant where String and StringBuffers are NOT disambiguated according to allocation site.static final int
A policy variant whereThrowable
instances are NOT disambiguated according to allocation site.a Map from CGNode->Set<IClass> that should be smushed. -
Constructor Summary
ConstructorDescriptionZeroXInstanceKeys
(AnalysisOptions options, IClassHierarchy cha, RTAContextInterpreter contextInterpreter, int policy) -
Method Summary
Modifier and TypeMethodDescriptionboolean
protected IClassHierarchy
getInstanceKeyForAllocation
(CGNode node, NewSiteReference allocation) <T> InstanceKey
getInstanceKeyForConstant
(TypeReference type, T S) getInstanceKeyForMetadataObject
(Object obj, TypeReference objType) getInstanceKeyForMultiNewArray
(CGNode node, NewSiteReference allocation, int dim) getInstanceKeyForPEI
(CGNode node, ProgramCounter pei, TypeReference type) boolean
A class is "interesting" iff we distinguish instances of the classstatic boolean
static boolean
static boolean
boolean
-
Field Details
-
JavaLangStringBuffer
-
JavaLangStringBuilder
-
JavaLangAbstractStringBuilder
-
NONE
public static final int NONEThe NONE policy is not allocation-site based- See Also:
-
ALLOCATIONS
public static final int ALLOCATIONSAn ALLOCATIONS - based policy distinguishes instances by allocation site. Otherwise, the policy distinguishes instances by type.- See Also:
-
SMUSH_STRINGS
public static final int SMUSH_STRINGSA policy variant where String and StringBuffers are NOT disambiguated according to allocation site.- See Also:
-
SMUSH_THROWABLES
public static final int SMUSH_THROWABLESA policy variant whereThrowable
instances are NOT disambiguated according to allocation site.- See Also:
-
SMUSH_PRIMITIVE_HOLDERS
public static final int SMUSH_PRIMITIVE_HOLDERSA policy variant where if a type T has only primitive instance fields, then instances of type T are NOT disambiguated by allocation site.- See Also:
-
SMUSH_MANY
public static final int SMUSH_MANYThis variant counts the N, number of allocation sites of a particular type T in each method. If N > SMUSH_LIMIT, then these N allocation sites are NOT distinguished ... instead there is a single abstract allocation site for <N,T>Probably the best choice in many cases.
- See Also:
-
CONSTANT_SPECIFIC
public static final int CONSTANT_SPECIFICShould we use constant-specific keys?- See Also:
-
smushMap
-
-
Constructor Details
-
ZeroXInstanceKeys
public ZeroXInstanceKeys(AnalysisOptions options, IClassHierarchy cha, RTAContextInterpreter contextInterpreter, int policy)
-
-
Method Details
-
smushThrowables
public boolean smushThrowables() -
disambiguateConstants
public boolean disambiguateConstants() -
getInstanceKeyForAllocation
- Specified by:
getInstanceKeyForAllocation
in interfaceInstanceKeyFactory
- Returns:
- the instance key that represents a particular allocation
-
getInstanceKeyForMultiNewArray
public InstanceKey getInstanceKeyForMultiNewArray(CGNode node, NewSiteReference allocation, int dim) - Specified by:
getInstanceKeyForMultiNewArray
in interfaceInstanceKeyFactory
- Returns:
- the instance key that represents the array allocated as the dim_th dimension at a particular allocation
-
getInstanceKeyForConstant
- Specified by:
getInstanceKeyForConstant
in interfaceInstanceKeyFactory
- Returns:
- the instance key that represents a constant with value S, when considered as a particular type
-
getInstanceKeyForPEI
- Specified by:
getInstanceKeyForPEI
in interfaceInstanceKeyFactory
- Returns:
- the instance key that represents the exception of type _type_ thrown by a particular PEI.
-
getInstanceKeyForMetadataObject
- Specified by:
getInstanceKeyForMetadataObject
in interfaceInstanceKeyFactory
- Parameters:
objType
- TODO- Returns:
- the instance key that represents the metadata object obj
-
isInteresting
A class is "interesting" iff we distinguish instances of the class -
isStringish
-
isThrowable
-
isStackTraceElement
-
getClassHierarchy
-
getClassBasedInstanceKeys
-