| java.lang.Object org.quilt.cl.SortedBlocks
SortedBlocks | public class SortedBlocks (Code) | | Manages an index into the bytecode vertices in a method's control flow
graph. The vertices (blocks) are indexed by their position in the
original code. The blocks may be from different graphs in a set of
nested graphs.
author: < a href="jdd@dixons.org">Jim Dixon |
Constructor Summary | |
public | SortedBlocks() Creates an empty map. |
Method Summary | |
public boolean | add(CodeVertex v) Add a vertex at its bytecode position. | public CodeVertex | add(int pos, Edge e) Add a vertex at bytecode offset pos along edge e. | public boolean | exists(int pos) | public CodeVertex | find(int pos, ControlFlowGraph currGraph, Edge e) Find or create a code vertex starting at a given position.
Parameters: pos - Byte offset in the original bytecode. Parameters: e - If the vertex must be created, Edge into which itgets inserted. | public CodeVertex | get(int pos) Find the code vertex starting at a given bytecode offset.
The vertex must exist. | public int | size() | public String | toString() Standard toString(), XXX needs some work. |
SortedBlocks | public SortedBlocks()(Code) | | Creates an empty map.
|
add | public boolean add(CodeVertex v)(Code) | | Add a vertex at its bytecode position. * It is an
error if there is already a vertex at this position.
XXX SHOULD THROW EXCEPTION IN SUCH A CASE.
Parameters: v - CodeVertex to be inserted True if the operation succeeds, false if something isalready present at that position. |
add | public CodeVertex add(int pos, Edge e)(Code) | | Add a vertex at bytecode offset pos along edge e. No other
vertex with that bytecode offset may exist.
Parameters: pos - Bytecode offset. Parameters: e - Edge along which the Vertex will be created Reference to the Vertex created. |
exists | public boolean exists(int pos)(Code) | | Does a vertex exist with this bytecode offset?
|
find | public CodeVertex find(int pos, ControlFlowGraph currGraph, Edge e)(Code) | | Find or create a code vertex starting at a given position.
Parameters: pos - Byte offset in the original bytecode. Parameters: e - If the vertex must be created, Edge into which itgets inserted. Otherwise, edge target becomesthe existing vertex. |
get | public CodeVertex get(int pos)(Code) | | Find the code vertex starting at a given bytecode offset.
The vertex must exist. XXX Should throw an exception if
it doesn't.
Parameters: pos - Bytecode offset of first instruction in the block. The matching vertex. |
size | public int size()(Code) | | How many code vertices are currently in the index?
The number of vertices in the index. |
toString | public String toString()(Code) | | Standard toString(), XXX needs some work.
Roughly formatted table of vertices. |
|
|