| java.lang.Object org.quilt.graph.Vertex org.quilt.cl.CodeVertex
All known Subclasses: org.quilt.cover.stmt.CounterVertex,
CodeVertex | public class CodeVertex extends Vertex (Code) | | A Vertex extended to carry the initial bytecode offset, line
number, and an instruction list.
author: Jim Dixon |
Field Summary | |
protected Instruction | connInst_ Instruction connecting this vertex to other(s). | protected int | endLine_ | protected InstructionList | ilist | protected int | pos | protected int | startLine_ Line number in source code corresponding to first instruction,
or if there is no such instruction, of the connecting instruction. |
Method Summary | |
public Instruction | getConnInst() Get connecting instruction. | public int | getEndLine() Get the line number in source code corresponding to the
connecting instruction or last instruction in the block. | public InstructionList | getInstructionList() Get a reference to the InstructionList carried by the vertex. | public int | getPosition() Get the bytecode offset of the first instruction. | public int | getStartLine() Get the source code line number of the first instruction in a
code vertex. | public void | moveGoto(CodeVertex target) Move this code vertex's Goto to another code vertex. | public void | setConnInst(Instruction i) Set the connecting instruction for this vertex. | public void | setEndLine(int n) Set the source line number of the connecting instruction, or of
the last line number in the block if there is no connecting
instruction. | public void | setPos(int position) Set the bytecode offset for the first instruction. | public void | setStartLine(int n) Set the source code line number. | public String | toString() | public String | toString(boolean b) Optionally more verbose method.
Parameters: b - If true, add label (if any) and instruction list. |
connInst_ | protected Instruction connInst_(Code) | | Instruction connecting this vertex to other(s).
|
endLine_ | protected int endLine_(Code) | | Line number in source code corresponding to the connecting
instruction, or if there is no such instruction, to the last
instruction in the block
|
ilist | protected InstructionList ilist(Code) | | the bytecode iteself
|
pos | protected int pos(Code) | | initial offset of first instruction in bytecode
|
startLine_ | protected int startLine_(Code) | | Line number in source code corresponding to first instruction,
or if there is no such instruction, of the connecting instruction.
|
CodeVertex | public CodeVertex(ControlFlowGraph g)(Code) | | Create a code vertex with default bytecode offset, line number,
empty instruction list, and no label.
Parameters: g - Graph which the vertex belongs to. |
CodeVertex | public CodeVertex(ControlFlowGraph g, int position)(Code) | | Create a code vertex, specifying a non-negative bytecode offset.
Parameters: g - Graph which the vertex belongs to. Parameters: position - Offset of the first instruction in the bytecode. |
CodeVertex | public CodeVertex(ControlFlowGraph g, String l)(Code) | | Create a code vertex, specifying a label
Parameters: g - Graph which the vertex belongs to. Parameters: l - The String label applied to the vertex. |
getConnInst | public Instruction getConnInst()(Code) | | Get connecting instruction.
|
getEndLine | public int getEndLine()(Code) | | Get the line number in source code corresponding to the
connecting instruction or last instruction in the block.
|
getInstructionList | public InstructionList getInstructionList()(Code) | | Get a reference to the InstructionList carried by the vertex.
This is a doubly indirect reference to the first instruction
in the list.
Instruction list. |
getPosition | public int getPosition()(Code) | | Get the bytecode offset of the first instruction.
The initial bytecode offset of the first instructioncarried by the vertex (excluding any connection instruction. |
getStartLine | public int getStartLine()(Code) | | Get the source code line number of the first instruction in a
code vertex.
Non-negative integer or -1, meaning no line number assigned. |
moveGoto | public void moveGoto(CodeVertex target)(Code) | | Move this code vertex's Goto to another code vertex. The
second vertex will be the target on the otherEdge from this
vertex. This vertex has a BinaryConnector. The second vertex
has a UnaryConnector.
The goto instruction does NOT point to the target. The target
is some sort of instrumentation being inserted into the graph.
|
setConnInst | public void setConnInst(Instruction i)(Code) | | Set the connecting instruction for this vertex.
|
setEndLine | public void setEndLine(int n)(Code) | | Set the source line number of the connecting instruction, or of
the last line number in the block if there is no connecting
instruction.
Parameters: n - Source code end line number. |
setPos | public void setPos(int position)(Code) | | Set the bytecode offset for the first instruction.
XXX Should rename this to setPosition to match the
get method.
Parameters: position - A non-negative integer representing the bytecodeposition of the first instruction. |
setStartLine | public void setStartLine(int n)(Code) | | Set the source code line number.
Parameters: n - Source code line number. |
toString | public String toString()(Code) | | Less verbose toString.
Graph index and Vertex index in a neatly formatted String,not* newline-terminated. |
toString | public String toString(boolean b)(Code) | | Optionally more verbose method.
Parameters: b - If true, add label (if any) and instruction list. A neatly formatted String. |
|
|