Class ZeroXInstanceKeys
java.lang.Object
com.ibm.wala.ipa.callgraph.propagation.cfa.ZeroXInstanceKeys
- All Implemented Interfaces:
InstanceKeyFactory
Flexible class to create
InstanceKeys depending on various policies ranging from
class-based (i.e. 0-CFA) to allocation-site-based (0-1-CFA variants).-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intAn ALLOCATIONS - based policy distinguishes instances by allocation site.static final intShould we use constant-specific keys?static final TypeReferencestatic final TypeReferencestatic final TypeReferencestatic final intThe NONE policy is not allocation-site basedstatic final intThis variant counts the N, number of allocation sites of a particular type T in each method.static final intA 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 intA policy variant where String and StringBuffers are NOT disambiguated according to allocation site.static final intA policy variant whereThrowableinstances are NOT disambiguated according to allocation site.a Map from CGNode->Set<IClass> that should be smushed. -
Constructor Summary
ConstructorsConstructorDescriptionZeroXInstanceKeys(AnalysisOptions options, IClassHierarchy cha, RTAContextInterpreter contextInterpreter, int policy) -
Method Summary
Modifier and TypeMethodDescriptionbooleanprotected IClassHierarchygetInstanceKeyForAllocation(CGNode node, NewSiteReference allocation) <T> InstanceKeygetInstanceKeyForConstant(TypeReference type, T S) getInstanceKeyForMetadataObject(Object obj, TypeReference objType) getInstanceKeyForMultiNewArray(CGNode node, NewSiteReference allocation, int dim) getInstanceKeyForPEI(CGNode node, ProgramCounter pei, TypeReference type) booleanA class is "interesting" iff we distinguish instances of the classstatic booleanstatic booleanstatic booleanboolean
-
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 whereThrowableinstances 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:
getInstanceKeyForAllocationin interfaceInstanceKeyFactory- Returns:
- the instance key that represents a particular allocation
-
getInstanceKeyForMultiNewArray
public InstanceKey getInstanceKeyForMultiNewArray(CGNode node, NewSiteReference allocation, int dim) - Specified by:
getInstanceKeyForMultiNewArrayin interfaceInstanceKeyFactory- Returns:
- the instance key that represents the array allocated as the dim_th dimension at a particular allocation
-
getInstanceKeyForConstant
- Specified by:
getInstanceKeyForConstantin interfaceInstanceKeyFactory- Returns:
- the instance key that represents a constant with value S, when considered as a particular type
-
getInstanceKeyForPEI
- Specified by:
getInstanceKeyForPEIin interfaceInstanceKeyFactory- Returns:
- the instance key that represents the exception of type _type_ thrown by a particular PEI.
-
getInstanceKeyForMetadataObject
- Specified by:
getInstanceKeyForMetadataObjectin 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
-