Package com.ibm.wala.cast.ipa.callgraph
Class ScopeMappingInstanceKeys
- java.lang.Object
-
- com.ibm.wala.cast.ipa.callgraph.ScopeMappingInstanceKeys
-
- All Implemented Interfaces:
InstanceKeyFactory
public abstract class ScopeMappingInstanceKeys extends Object implements InstanceKeyFactory
AnInstanceKeyFactorythat returnsScopeMappingInstanceKeys.ScopeMappingInstanceKeys as necessary to handle interprocedural lexical scoping (specifically, to handle closure creation when a function escapes its allocating scope)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classScopeMappingInstanceKeys.ScopeMappingInstanceKeyAnInstanceKeycarrying information about whichCGNodes represent lexical parents of the allocatingCGNode.
-
Field Summary
Fields Modifier and Type Field Description protected PropagationCallGraphBuilderbuilder
-
Constructor Summary
Constructors Constructor Description ScopeMappingInstanceKeys(PropagationCallGraphBuilder builder, InstanceKeyFactory basic)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Collection<CGNode>getConstructorCallers(ScopeMappingInstanceKeys.ScopeMappingInstanceKey smik, Pair<String,String> name)get the CGNodes corresponding to the method that invoked the constructor for smikInstanceKeygetInstanceKeyForAllocation(CGNode creatorNode, NewSiteReference allocationSite)InstanceKeygetInstanceKeyForConstant(TypeReference type, Object S)InstanceKeygetInstanceKeyForMetadataObject(Object obj, TypeReference objType)InstanceKeygetInstanceKeyForMultiNewArray(CGNode node, NewSiteReference allocation, int dim)InstanceKeygetInstanceKeyForPEI(CGNode node, ProgramCounter instr, TypeReference type)protected abstract booleanneedsScopeMappingKey(InstanceKey base)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
-
-
-
Field Detail
-
builder
protected final PropagationCallGraphBuilder builder
-
-
Constructor Detail
-
ScopeMappingInstanceKeys
public ScopeMappingInstanceKeys(PropagationCallGraphBuilder builder, InstanceKeyFactory basic)
-
-
Method Detail
-
needsScopeMappingKey
protected abstract boolean needsScopeMappingKey(InstanceKey base)
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
-
getInstanceKeyForAllocation
public InstanceKey getInstanceKeyForAllocation(CGNode creatorNode, NewSiteReference allocationSite)
- 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
public InstanceKey getInstanceKeyForConstant(TypeReference type, Object S)
- Specified by:
getInstanceKeyForConstantin interfaceInstanceKeyFactory- Returns:
- the instance key that represents a constant with value S, when considered as a particular type
-
getInstanceKeyForPEI
public InstanceKey getInstanceKeyForPEI(CGNode node, ProgramCounter instr, TypeReference type)
- Specified by:
getInstanceKeyForPEIin interfaceInstanceKeyFactory- Returns:
- the instance key that represents the exception of type _type_ thrown by a particular PEI.
-
getInstanceKeyForMetadataObject
public InstanceKey getInstanceKeyForMetadataObject(Object obj, TypeReference objType)
- Specified by:
getInstanceKeyForMetadataObjectin interfaceInstanceKeyFactoryobjType- TODO- Returns:
- the instance key that represents the metadata object obj
-
-