public abstract class StickFirstMatches extends HeapAbstractionFactory
CrossProductAnalysis
, to distinguish calls to particular methods
or packages. For example to calls to the standard library by matching
"java.lang" as a prefix.Modifier and Type | Field and Description |
---|---|
CContext |
EMPTY_CONTEXT
Empty context represents methods with no invoking objects (including
static methods).
|
Constructor and Description |
---|
StickFirstMatches()
Create an analysis with the default sensitivity and default string.
|
StickFirstMatches(int sensitivity)
Create an analysis that tracks methods with a particular prefix with the
given context-call-stack depth, once that depth is reached the context is
"stuck" and no more call sites are added.
|
Modifier and Type | Method and Description |
---|---|
void |
init()
Initialize the factory.
|
CContext |
initialContextImpl()
Return the initial CContext, i.e., to analyze the main method.
|
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 |
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 . |
abstract java.lang.String |
toString() |
clearMemoization, fixContextForReferenceVariable, initialContext, memoize, memoize, merge, record
public CContext EMPTY_CONTEXT
public StickFirstMatches()
public StickFirstMatches(int sensitivity)
sensitivity
- depth of the call stack to keep track ofprefixToTrack
- Methods with this prefix will be tracked up to the sensitivity,
deeper than the sensitivity they will "stick" in the context.public abstract java.lang.String toString()
toString
in class java.lang.Object
public HContext recordImpl(CContext context, AllocSiteNode alloc)
HeapAbstractionFactory
alloc
in code
context context
.recordImpl
in class HeapAbstractionFactory
public CContext mergeImpl(CallSiteNode callSite, HContext receiver, CContext callerContext)
HeapAbstractionFactory
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.mergeImpl
in class HeapAbstractionFactory
public void init()
HeapAbstractionFactory
init
in class HeapAbstractionFactory
public CContext initialContextImpl()
HeapAbstractionFactory
initialContextImpl
in class HeapAbstractionFactory