|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vasco.InterProceduralAnalysis<M,N,A> vasco.ForwardInterProceduralAnalysis<M,N,A>
M
- the type of a methodN
- the type of a node in the CFGA
- the type of a data flow valuepublic abstract class ForwardInterProceduralAnalysis<M,N,A>
A generic forward-flow inter-procedural analysis which is fully context-sensitive.
This class essentially captures a forward data flow problem which can be
solved using the context-sensitive inter-procedural analysis framework as
described in InterProceduralAnalysis
.
This is the class that client analyses will extend in order to perform forward-flow inter-procedural analysis.
Field Summary |
---|
Fields inherited from class vasco.InterProceduralAnalysis |
---|
contexts, contextTransitions, freeResultsOnTheFly, reverse, verbose, worklist |
Constructor Summary | |
---|---|
ForwardInterProceduralAnalysis()
Constructs a new forward-flow inter-procedural analysis. |
Method Summary | |
---|---|
abstract A |
callEntryFlowFunction(Context<M,N,A> context,
M targetMethod,
N node,
A inValue)
Processes the inter-procedural flow function for a method call at the start of the call, to handle parameters. |
abstract A |
callExitFlowFunction(Context<M,N,A> context,
M targetMethod,
N node,
A exitValue)
Processes the inter-procedural flow function for a method call at the end of the call, to handle return values. |
abstract A |
callLocalFlowFunction(Context<M,N,A> context,
N node,
A inValue)
Processes the intra-procedural flow function for a method call at the call-site itself, to handle propagation of local values that are not involved in the call. |
void |
doAnalysis()
Performs the actual data flow analysis. |
protected Context<M,N,A> |
initContext(M method,
A entryValue)
Creates a new value context and initialises data flow values for its nodes. |
abstract A |
normalFlowFunction(Context<M,N,A> context,
N node,
A inValue)
Processes the intra-procedural flow function of a statement that does not contain a method call. |
Methods inherited from class vasco.InterProceduralAnalysis |
---|
boundaryValue, copy, getCallers, getContext, getContexts, getContextTransitionTable, getMeetOverValidPathsSolution, getMethods, getTargets, meet, programRepresentation, topValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ForwardInterProceduralAnalysis()
Method Detail |
---|
public void doAnalysis()
A work-list of contexts is maintained, each with it's own work-list of CFG nodes to process. For each node removed from the work-list of the newest context, the meet of values along incoming edges (in the direction of analysis) is computed and then the flow function is processed depending on whether the node contains a call or not. If the resulting data flow value has changed, then nodes along outgoing edges (in the direction of analysis) are also added to the work-list.
Analysis starts with the context for the program entry points with the given boundary values and ends when the work-list is empty.
See the SOAP '13 paper for the full algorithm in Figure 1.
doAnalysis
in class InterProceduralAnalysis<M,N,A>
protected Context<M,N,A> initContext(M method, A entryValue)
The following steps are performed:
method
- the method whose context to createentryValue
- the data flow value at the entry of this methodpublic abstract A normalFlowFunction(Context<M,N,A> context, N node, A inValue)
context
- the value context at the call-sitenode
- the statement whose flow function to processinValue
- the data flow value before the statement
public abstract A callEntryFlowFunction(Context<M,N,A> context, M targetMethod, N node, A inValue)
context
- the value context at the call-sitetargetMethod
- the target (or one of the targets) of this call sitenode
- the statement containing the method callinValue
- the data flow value before the call
public abstract A callExitFlowFunction(Context<M,N,A> context, M targetMethod, N node, A exitValue)
context
- the value context at the call-sitetargetMethod
- the target (or one of the targets) of this call sitenode
- the statement containing the method callexitValue
- the data flow value at the exit of the called procedure
public abstract A callLocalFlowFunction(Context<M,N,A> context, N node, A inValue)
context
- the value context at the call-sitenode
- the statement containing the method callinValue
- the data flow value before the call
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |