public class FlowFunctionCache<N,D,M> extends java.lang.Object implements FlowFunctions<N,D,M>
Modifier and Type | Field and Description |
---|---|
protected <any> |
callCache |
protected <any> |
callToReturnCache |
protected FlowFunctions<N,D,M> |
delegate |
protected <any> |
normalCache |
protected <any> |
returnCache |
Constructor and Description |
---|
FlowFunctionCache(FlowFunctions<N,D,M> delegate,
CacheBuilder builder) |
Modifier and Type | Method and Description |
---|---|
FlowFunction<D> |
getCallFlowFunction(N callStmt,
M destinationMethod)
Returns the flow function that computes the flow for a call statement.
|
FlowFunction<D> |
getCallToReturnFlowFunction(N callSite,
N returnSite)
Returns the flow function that computes the flow from a call site to a
successor statement just after the call.
|
FlowFunction<D> |
getNormalFlowFunction(N curr,
N succ)
Returns the flow function that computes the flow for a normal statement,
i.e., a statement that is neither a call nor an exit statement.
|
FlowFunction<D> |
getReturnFlowFunction(N callSite,
M calleeMethod,
N exitStmt,
N returnSite)
Returns the flow function that computes the flow for a an exit from a
method.
|
void |
printStats() |
protected final FlowFunctions<N,D,M> delegate
protected final <any> normalCache
protected final <any> callCache
protected final <any> returnCache
protected final <any> callToReturnCache
public FlowFunctionCache(FlowFunctions<N,D,M> delegate, CacheBuilder builder)
public FlowFunction<D> getNormalFlowFunction(N curr, N succ)
FlowFunctions
getNormalFlowFunction
in interface FlowFunctions<N,D,M>
curr
- The current statement.succ
- The successor for which the flow is computed. This value can
be used to compute a branched analysis that propagates
different values depending on where control0flow branches.public FlowFunction<D> getCallFlowFunction(N callStmt, M destinationMethod)
FlowFunctions
getCallFlowFunction
in interface FlowFunctions<N,D,M>
callStmt
- The statement containing the invoke expression giving rise to
this call.destinationMethod
- The concrete target method for which the flow is computed.public FlowFunction<D> getReturnFlowFunction(N callSite, M calleeMethod, N exitStmt, N returnSite)
FlowFunctions
getReturnFlowFunction
in interface FlowFunctions<N,D,M>
callSite
- One of all the call sites in the program that called the
method from which the exitStmt is actually returning. This
information can be exploited to compute a value that depends on
information from before the call.
Note: This value might be null
if
using a tabulation problem with SolverConfiguration.followReturnsPastSeeds()
returning true
in a situation where the call graph
does not contain a caller for the method that is returned from.calleeMethod
- The method from which exitStmt returns.exitStmt
- The statement exiting the method, typically a return or throw
statement.returnSite
- One of the successor statements of the callSite. There may be
multiple successors in case of possible exceptional flow. This
method will be called for each such successor.
Note: This value might be null
if
using a tabulation problem with SolverConfiguration.followReturnsPastSeeds()
returning true
in a situation where the call graph
does not contain a caller for the method that is returned from.public FlowFunction<D> getCallToReturnFlowFunction(N callSite, N returnSite)
FlowFunctions
FlowFunctions.getCallFlowFunction(Object, Object)
, only
such information that actually concerns the callee method. All other
information, e.g. information that cannot be modified by the call, is
passed along this call-return edge.getCallToReturnFlowFunction
in interface FlowFunctions<N,D,M>
callSite
- The statement containing the invoke expression giving rise to
this call.returnSite
- The return site to which the information is propagated. For
exceptional flow, this may actually be the start of an
exception handler.public void printStats()