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
AnInstanceKeyFactory
that returnsScopeMappingInstanceKeys.ScopeMappingInstanceKey
s 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 class
ScopeMappingInstanceKeys.ScopeMappingInstanceKey
AnInstanceKey
carrying information about whichCGNode
s represent lexical parents of the allocatingCGNode
.
-
Field Summary
Fields Modifier and Type Field Description protected PropagationCallGraphBuilder
builder
-
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 smikInstanceKey
getInstanceKeyForAllocation(CGNode creatorNode, NewSiteReference allocationSite)
InstanceKey
getInstanceKeyForConstant(TypeReference type, Object S)
InstanceKey
getInstanceKeyForMetadataObject(Object obj, TypeReference objType)
InstanceKey
getInstanceKeyForMultiNewArray(CGNode node, NewSiteReference allocation, int dim)
InstanceKey
getInstanceKeyForPEI(CGNode node, ProgramCounter instr, TypeReference type)
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
-
-
-
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:
getInstanceKeyForAllocation
in 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:
getInstanceKeyForMultiNewArray
in 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:
getInstanceKeyForConstant
in 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:
getInstanceKeyForPEI
in 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:
getInstanceKeyForMetadataObject
in interfaceInstanceKeyFactory
objType
- TODO- Returns:
- the instance key that represents the metadata object obj
-
-