Package com.ibm.wala.cast.ipa.callgraph
Class ScopeMappingInstanceKeys.ScopeMappingInstanceKey
- java.lang.Object
-
- com.ibm.wala.cast.ipa.callgraph.ScopeMappingInstanceKeys.ScopeMappingInstanceKey
-
- All Implemented Interfaces:
ContextItem
,InstanceKey
- Enclosing class:
- ScopeMappingInstanceKeys
public class ScopeMappingInstanceKeys.ScopeMappingInstanceKey extends Object implements InstanceKey
AnInstanceKey
carrying information about whichCGNode
s represent lexical parents of the allocatingCGNode
. The fact that we discover at most oneCGNode
per lexical parent relies on the following property: in a call graph, the contexts used for a nested function can be finer than those used for the containing function, but _not_ coarser. This ensures that there is at most one CGNode corresponding to a lexical parent (e.g., we don't get two clones of function f1() invoking a single CGNode representing nested function f2()) Note that it is possible to not find aCGNode
corresponding to some lexical parent; this occurs when a deeply nested function is returned before being invoked, so some lexical parent is no longer on the call stack when the function is allocated. See test case nested.js.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.ibm.wala.ipa.callgraph.ContextItem
ContextItem.Value<T>
-
-
Constructor Summary
Constructors Constructor Description ScopeMappingInstanceKey(CGNode creator, InstanceKey base)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
InstanceKey
getBase()
IClass
getConcreteType()
For now, we assert that each InstanceKey represents a set of classes which are all of the same concrete type (modulo the fact that all arrays of references are considered concrete type []Object;)Iterator<Pair<CGNode,NewSiteReference>>
getCreationSites(CallGraph CG)
Get the creation sites ofthis
, i.e., the statements that may allocate objects represented bythis
.CGNode
getCreator()
Iterator<CGNode>
getFunargNodes(Pair<String,String> name)
get the CGNode representing the lexical parent ofcreator
with name definerint
hashCode()
String
toString()
-
-
-
Constructor Detail
-
ScopeMappingInstanceKey
public ScopeMappingInstanceKey(CGNode creator, InstanceKey base)
-
-
Method Detail
-
getConcreteType
public IClass getConcreteType()
Description copied from interface:InstanceKey
For now, we assert that each InstanceKey represents a set of classes which are all of the same concrete type (modulo the fact that all arrays of references are considered concrete type []Object;)- Specified by:
getConcreteType
in interfaceInstanceKey
-
getFunargNodes
public Iterator<CGNode> getFunargNodes(Pair<String,String> name)
get the CGNode representing the lexical parent ofcreator
with name definer- Parameters:
definer
-- Returns:
-
getBase
public InstanceKey getBase()
-
getCreator
public CGNode getCreator()
-
getCreationSites
public Iterator<Pair<CGNode,NewSiteReference>> getCreationSites(CallGraph CG)
Description copied from interface:InstanceKey
Get the creation sites ofthis
, i.e., the statements that may allocate objects represented bythis
. A creation site is a pair (n,s), where n is the containingCGNode
in the givenCallGraph
CG
and s is the allocatingNewSiteReference
.- Specified by:
getCreationSites
in interfaceInstanceKey
-
-