|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vasco.Context<M,N,A>
M
- the type of a methodN
- the type of a node in the CFGA
- the type of a data flow valuepublic class Context<M,N,A>
A value-based context for a context-sensitive inter-procedural data flow analysis.
A value-based context is identified as a pair of a method and the data flow value at the entry of the method, for forward flows, or the data flow value at the exit of the method, for backward flows. Thus, if two distinct calls are made to a method and each call-site has the same data flow value then it is considered that the target of that call is the same context. This concept allows termination in the presence of recursion as the number of contexts is limited by the size of the lattice (which must be finite).
Each value context has its own work-list of CFG nodes to analyse, and the results of analysis are stored in a map from nodes to the data flow values before/after the node.
Constructor Summary | |
---|---|
Context(M method,
DirectedGraph<N> cfg,
boolean reverse)
Creates a new context for the given method. |
Method Summary | |
---|---|
int |
compareTo(Context<M,N,A> other)
Compares two contexts by their globally unique IDs. |
DirectedGraph<N> |
getControlFlowGraph()
Returns a reference to the control flow graph of this context's method. |
static int |
getCount()
Returns the total number of contexts created so far. |
A |
getEntryValue()
Returns a reference to the data flow value at the method entry. |
A |
getExitValue()
Returns a reference to the data flow value at the method exit. |
int |
getId()
Returns the globally unique identifier of this context. |
M |
getMethod()
Returns a reference to this context's method. |
A |
getValueAfter(N node)
Gets the data flow value at the exit of the given node. |
A |
getValueBefore(N node)
Gets the data flow value at the entry of the given node. |
NavigableSet<N> |
getWorkList()
Returns a reference to this context's work-list. |
boolean |
isAnalysed()
Returns whether or not this context has been analysed at least once. |
void |
setEntryValue(A entryValue)
Sets the entry flow of this context. |
void |
setExitValue(A exitValue)
Sets the exit flow of this context. |
void |
setValueAfter(N node,
A value)
Sets the data flow value at the exit of the given node. |
void |
setValueBefore(N node,
A value)
Sets the data flow value at the entry of the given node. |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Context(M method, DirectedGraph<N> cfg, boolean reverse)
method
- the method to which this value context belongscfg
- the control-flow graph for the body of methodreverse
- true if the analysis is in the reverse direction,
and false if the analysis is in the forward directionMethod Detail |
---|
public int compareTo(Context<M,N,A> other)
compareTo
in interface Comparable<Context<M,N,A>>
public DirectedGraph<N> getControlFlowGraph()
public static int getCount()
public A getEntryValue()
public A getExitValue()
public int getId()
public M getMethod()
public A getValueAfter(N node)
node
- a node in the control flow graph
public A getValueBefore(N node)
node
- a node in the control flow graph
public NavigableSet<N> getWorkList()
public boolean isAnalysed()
public void setEntryValue(A entryValue)
entryValue
- the new data flow value at the method entrypublic void setExitValue(A exitValue)
exitValue
- the new data flow value at the method exitpublic void setValueAfter(N node, A value)
node
- a node in the control flow graphvalue
- the new data flow at the node exitpublic void setValueBefore(N node, A value)
node
- a node in the control flow graphvalue
- the new data flow at the node entrypublic String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |