public abstract class HeapAbstractionFactory
extends java.lang.Object
Constructor and Description |
---|
HeapAbstractionFactory() |
Modifier and Type | Method and Description |
---|---|
void |
clearMemoization() |
CContext |
fixContextForReferenceVariable(CContext context,
ReferenceVariable r)
Fix the code context for a reference variable, if needed, when creating
a reference variable replica for reference variable
r . |
void |
init()
Initialize the factory.
|
CContext |
initialContext()
Return the initial CContext, i.e., to analyze the main method.
|
protected abstract CContext |
initialContextImpl()
Return the initial CContext, i.e., to analyze the main method.
|
protected static CContext |
memoize(CContext o) |
protected static HContext |
memoize(HContext o) |
CContext |
merge(CallSiteNode callSite,
HContext receiver,
CContext callerContext)
Produce a code context (i.e., CContext) to analysis code
called from call site
callSite in code context
callerContext , where receiver is
the abstract object for the receiver of the method invocation. |
protected abstract CContext |
mergeImpl(CallSiteNode callSite,
HContext receiver,
CContext callerContext)
Produce a code context (i.e., CContext) to analysis code
called from call site
callSite in code context
callerContext , where receiver is
the abstract object for the recevier of the method invocation. |
HContext |
record(CContext context,
AllocSiteNode alloc)
Produce an abstract object (i.e., HContext) to represent an
object created at allocation site
alloc in code
context context . |
protected abstract HContext |
recordImpl(CContext context,
AllocSiteNode alloc)
Produce an abstract object (i.e., HContext) to represent an
object created at allocation site
alloc in code
context context . |
public final HContext record(CContext context, AllocSiteNode alloc)
alloc
in code
context context
. This method wraps recordImpl to
enforce memoization.protected abstract HContext recordImpl(CContext context, AllocSiteNode alloc)
alloc
in code
context context
.public final CContext merge(CallSiteNode callSite, HContext receiver, CContext callerContext)
callSite
in code context
callerContext
, where receiver
is
the abstract object for the receiver of the method invocation.
If the method being called does not have a receiver (i.e., it
is a static method), then receiver
will be null.
This method wraps mergeImpl to
enforce memoization.protected abstract CContext mergeImpl(CallSiteNode callSite, HContext receiver, CContext callerContext)
callSite
in code context
callerContext
, where receiver
is
the abstract object for the recevier of the method invocation.
If the method being called does not have a receiver (i.e., it
is a static method), then receiver
will be null.public CContext fixContextForReferenceVariable(CContext context, ReferenceVariable r)
r
.
The need for this method is motivated by an object sensitive analysis
where static fields should only have a single replica, i.e., if f is a static
field of C, and o is an object of class C, then an expression o.f should
be represented by a reference variable replica that has the
ObjectField for C.f in the unique static context, not the context for o.public final CContext initialContext()
protected abstract CContext initialContextImpl()
public void init()
public void clearMemoization()