Class ContainerContextSelector
java.lang.Object
com.ibm.wala.ipa.callgraph.propagation.cfa.ContainerContextSelector
- All Implemented Interfaces:
ContextSelector
This context selector returns a context customized for the
InstanceKey of the receiver if
- receiver is a container, or
- was allocated in a node whose context was a
ReceiverInstanceContext, and the type is interesting according to a delegateZeroXInstanceKeys
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Atomstatic final TypeReferencestatic final MethodReferencestatic final TypeReference -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic CGNodeThis method walks recursively up the definition of a context C, to see if the chain of contexts that give rise to C includes the method M.static ContextThis method walks recursively up the definition of a context C, to see if the chain of contexts that give rise to C includes the method M.static ContextfindRecursiveMatchingContext(IMethod M, Context C, InstanceKey receiver) This method walks recursively up the definition of a context C, to see if the chain of contexts that give rise to C a) includes the method M.getCalleeTarget(CGNode caller, CallSiteReference site, IMethod callee, InstanceKey[] keys) Given a calling node and a call site, returns the Context in which the callee should be evaluated.protected IClassHierarchygetRelevantParameters(CGNode caller, CallSiteReference site) Given a calling node and a call site, return the set of parameters based on which this selector may choose to specialize contexts.static booleanDoes m represent a library method that copies arrays?protected booleanstatic booleanDoes m represent a static factory method we know about from the standard libraries, that we usually wish to model with one level of call-string context?booleanmayUnderstand(CallSiteReference site, IMethod targetMethod, InstanceKey receiver)
-
Field Details
-
SyntheticSystem
-
JavaUtilHashtable
-
arraycopyAtom
-
synthArraycopy
-
-
Constructor Details
-
ContainerContextSelector
- Parameters:
cha- governing class hierarchydelegate- object which determines which classes are "interesting"
-
-
Method Details
-
getCalleeTarget
public Context getCalleeTarget(CGNode caller, CallSiteReference site, IMethod callee, InstanceKey[] keys) Description copied from interface:ContextSelectorGiven a calling node and a call site, returns the Context in which the callee should be evaluated.- Specified by:
getCalleeTargetin interfaceContextSelector- Parameters:
caller- the node containing the call sitesite- description of the call sitekeys- the abstract objects (InstanceKeys) of parameters of interest to the selector- Returns:
- the Context in which the callee should be evaluated, or null if no information is available.
-
isWellKnownStaticFactory
Does m represent a static factory method we know about from the standard libraries, that we usually wish to model with one level of call-string context? -
isArrayCopyingMethod
Does m represent a library method that copies arrays? -
findRecursiveMatchingContext
This method walks recursively up the definition of a context C, to see if the chain of contexts that give rise to C a) includes the method M. or b) includes the method in which the receiver was allocated- Returns:
- the matching context if found, null otherwise
-
findNodeRecursiveMatchingContext
This method walks recursively up the definition of a context C, to see if the chain of contexts that give rise to C includes the method M.If C is a ReceiverInstanceContext, Let N be the node that allocated C.instance. If N.method == M, return N. Else return findRecursiveMatchingContext(M, N.context) Else return null
-
findRecursiveMatchingContext
This method walks recursively up the definition of a context C, to see if the chain of contexts that give rise to C includes the method M.If C is a ReceiverInstanceContext, Let N be the node that allocated C.instance. If N.method == M, return N.context. Else return findRecursiveMatchingContext(M, N.context) Else return null
-
mayUnderstand
-
isContainer
- Returns:
- true iff C is a container class
-
getClassHierarchy
-
getRelevantParameters
Description copied from interface:ContextSelectorGiven a calling node and a call site, return the set of parameters based on which this selector may choose to specialize contexts.- Specified by:
getRelevantParametersin interfaceContextSelector- Parameters:
caller- the calling nodesite- the specific call site- Returns:
- the set of parameters of interest
-