public abstract class AnalysisContextPolicy<C extends AnalysisContext> extends Object
Constructor and Description |
---|
AnalysisContextPolicy(C emptyContext) |
Modifier and Type | Method and Description |
---|---|
abstract C |
allocationContext(C allocatorContext,
int maxHeapContextDepth)
Given the allocator method context this method returns the allocation context for a heap
allocated object.
|
abstract C |
calleeContext(BigBang bb,
AnalysisObject receiverObject,
C callerContext,
MethodTypeFlow callee)
Given the receiver object, caller context and callee this method returns the callee context
for a virtual or special invoke.
|
C |
emptyContext()
Returns the empty context, i.e., the outer most context.
|
static BytecodeLocation[] |
extend(BytecodeLocation[] labelList,
BytecodeLocation add)
Extends the input label list with a context label.
|
static BytecodeLocation[] |
extend(BytecodeLocation[] labelList,
BytecodeLocation add,
int maxDepth)
Extends the input label list with a context label.
|
boolean |
isEmpty(C context) |
AnalysisContext |
lookupContext(C context) |
static BytecodeLocation[] |
peel(BytecodeLocation[] labelList,
int maxDepth) |
abstract C |
peel(C context,
int maxDepth)
Peels off the least recent labels from the current context, down to
maxDepth depth. |
static BytecodeLocation[] |
prepend(BytecodeLocation add,
BytecodeLocation[] labelList)
Prepends the context label to the input label list.
|
abstract C |
staticCalleeContext(BigBang bb,
BytecodeLocation invokeLocation,
C callerContext,
MethodTypeFlow callee)
Given the invocation location, caller context and callee this method returns the callee
context for a static invoke.
|
public AnalysisContextPolicy(C emptyContext)
public final C emptyContext()
public final boolean isEmpty(C context)
public abstract C calleeContext(BigBang bb, AnalysisObject receiverObject, C callerContext, MethodTypeFlow callee)
public abstract C staticCalleeContext(BigBang bb, BytecodeLocation invokeLocation, C callerContext, MethodTypeFlow callee)
public abstract C allocationContext(C allocatorContext, int maxHeapContextDepth)
public abstract C peel(C context, int maxDepth)
maxDepth
depth.
Only the most recent labels are kept in the context, preserving the temporal order.public static BytecodeLocation[] extend(BytecodeLocation[] labelList, BytecodeLocation add, int maxDepth)
maxDepth
. Only the most recent context labels are kept in the chain, in the order
that they appeared in the call chain.public static BytecodeLocation[] extend(BytecodeLocation[] labelList, BytecodeLocation add)
public static BytecodeLocation[] prepend(BytecodeLocation add, BytecodeLocation[] labelList)
public static BytecodeLocation[] peel(BytecodeLocation[] labelList, int maxDepth)
public AnalysisContext lookupContext(C context)