Class ScopeMappingInstanceKeys
java.lang.Object
com.ibm.wala.cast.ipa.callgraph.ScopeMappingInstanceKeys
- All Implemented Interfaces:
InstanceKeyFactory
- Direct Known Subclasses:
JavaScopeMappingInstanceKeys, JavaScriptScopeMappingInstanceKeys
An
InstanceKeyFactory that returns ScopeMappingInstanceKeys.ScopeMappingInstanceKeys as necessary to
handle interprocedural lexical scoping (specifically, to handle closure creation when a function
escapes its allocating scope)-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassAnInstanceKeycarrying information about whichCGNodes represent lexical parents of the allocatingCGNode. -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionScopeMappingInstanceKeys(PropagationCallGraphBuilder builder, InstanceKeyFactory basic) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract Collection<CGNode> getConstructorCallers(ScopeMappingInstanceKeys.ScopeMappingInstanceKey smik, Pair<String, String> name) get the CGNodes corresponding to the method that invoked the constructor for smikgetInstanceKeyForAllocation(CGNode creatorNode, NewSiteReference allocationSite) getInstanceKeyForConstant(TypeReference type, Object S) getInstanceKeyForMetadataObject(Object obj, TypeReference objType) getInstanceKeyForMultiNewArray(CGNode node, NewSiteReference allocation, int dim) getInstanceKeyForPEI(CGNode node, ProgramCounter instr, TypeReference type) protected abstract booleanisTrueConstructorCall(Pair<String, String> name, CGNode callerOfConstructor) protected abstract booleandoes base require a scope mapping key? Typically, true if base is allocated in a nested lexical scope, to handle the case of base being a function that performs closure accesses
-
Field Details
-
builder
-
-
Constructor Details
-
ScopeMappingInstanceKeys
-
-
Method Details
-
needsScopeMappingKey
does base require a scope mapping key? Typically, true if base is allocated in a nested lexical scope, to handle the case of base being a function that performs closure accesses -
isTrueConstructorCall
protected abstract boolean isTrueConstructorCall(Pair<String, String> name, CGNode callerOfConstructor) - Parameters:
name- the variable name and creator paircallerOfConstructor- the purported caller of the constructor- Returns:
- whether this is a real constructor call or an artifact of function pointers (always true for lexical scoping in Java)
-
getInstanceKeyForAllocation
- Specified by:
getInstanceKeyForAllocationin interfaceInstanceKeyFactory- Returns:
- the instance key that represents a particular allocation
-
getConstructorCallers
protected abstract Collection<CGNode> getConstructorCallers(ScopeMappingInstanceKeys.ScopeMappingInstanceKey smik, Pair<String, String> name) get the CGNodes corresponding to the method that invoked the constructor for smik -
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
-