de.rwth.dfa.jvm
Class BasicBlockGraph
java.lang.Object
|
+--de.rwth.graph.Graph
|
+--de.rwth.graph.RootedGraph
|
+--de.rwth.dfa.jvm.FactorisedFlowGraph
|
+--de.rwth.dfa.jvm.BasicBlockGraph
- public class BasicBlockGraph
- extends FactorisedFlowGraph
A class for the basic block graph of JVM methods. A basic block is a sequence of
instructions in a method, where the control flow is linear, i.e. no jumps (or
exceptions) can occur inside. For each basic block of a method, there is a node in
the graph. The label of the node is an InstructionHandleVector
of the
instructions.. For each possible control flow between two basic blocks, there is
an edge from the first to the second instruction.
The roots of this graph are those nodes, where the first instruction is a root in
the flow graph.
The leafs of this graph are those nodes, where the last instruction is a leaf in
the flow graph.
- Version:
- $Id: BasicBlockGraph.java,v 1.3 2002/09/17 06:53:53 mohnen Exp $
- Author:
- Markus Mohnen
Field Summary |
protected java.util.Hashtable |
blockNodes
Associates the nodes in the flow graph with the corresponding nodes in this
graph. |
protected java.util.Hashtable |
flowNodess
Associates a node in this graph with a vector of corresponding nodes in the flow
graph. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
blockNodes
protected java.util.Hashtable blockNodes
- Associates the nodes in the flow graph with the corresponding nodes in this
graph.
flowNodess
protected java.util.Hashtable flowNodess
- Associates a node in this graph with a vector of corresponding nodes in the flow
graph.
BasicBlockGraph
public BasicBlockGraph(FactorisedFlowGraph flowGraph)
- Creates a new
BasicBlockGraph
instance from a (factorised) flow
graph.
- Parameters:
flowGraph
- a FactorisedFlowGraph
value
findBasicBlocks
protected void findBasicBlocks(FactorisedFlowGraph flowGraph,
Graph.Node startNode,
Graph.NodeDyer visitedNodes,
Graph.Node newNode)
- Finds the basic blocks starting at a node in a flow graph.
- Parameters:
flowGraph
- a FactorisedFlowGraph
valuestartNode
- a Graph.Node
valuevisitedNodes
- a Graph.NodeDyer
valuenewNode
- a Graph.Node
value: An already created node in this
graph.
blockNode
public Graph.Node blockNode(Graph.Node flowNode)
- Returns the corresponding node in this graph for a node in the underlying flow
graph.
- Parameters:
flowNode
- a Graph.Node
value- Returns:
- a
Graph.Node
value
flowNodes
public java.util.Vector flowNodes(Graph.Node blockNode)
- Returns a vector of corresponding nodes in the flow graph for a node in this
graph.
- Parameters:
blockNode
- a Graph.Node
value- Returns:
- a
Vector
value