public class ScopeMappingInstanceKeys.ScopeMappingInstanceKey extends Object implements InstanceKey
InstanceKey carrying information about which CGNodes
represent lexical parents of the allocating CGNode.
The fact that we discover at most one CGNode 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 a CGNode 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.ContextItem.Value<T>| Constructor and Description |
|---|
ScopeMappingInstanceKey(CGNode creator,
InstanceKey base) |
| Modifier and Type | Method and 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 of
this, i.e., the statements that may
allocate objects represented by this. |
CGNode |
getCreator() |
Iterator<CGNode> |
getFunargNodes(Pair<String,String> name)
get the CGNode representing the lexical parent of
creator with
name definer |
int |
hashCode() |
String |
toString() |
public ScopeMappingInstanceKey(CGNode creator, InstanceKey base)
public IClass getConcreteType()
InstanceKeygetConcreteType in interface InstanceKeypublic Iterator<CGNode> getFunargNodes(Pair<String,String> name)
creator with
name definerdefiner - public InstanceKey getBase()
public CGNode getCreator()
public Iterator<Pair<CGNode,NewSiteReference>> getCreationSites(CallGraph CG)
InstanceKeythis, i.e., the statements that may
allocate objects represented by this. A creation site is a
pair (n,s), where n is the containing CGNode in the given
CallGraph CG and s is the allocating
NewSiteReference.getCreationSites in interface InstanceKey