| java.lang.Object org.quilt.cl.BytecodeCollector
BytecodeCollector | public class BytecodeCollector implements org.quilt.graph.Visitor(Code) | | Collects the bytecode for a method while walking the method
control flow graph.
Inspired by Quilt 0.5's BytecodeLayout,
author: David Dixon-Peugh and the author: rest of the Quilt development team. author: However, errors and omissions in this version are entirely due to author: Jim Dixon |
Method Summary | |
public void | discoverEdge(Edge e) Action taken upon first encountering an edge. | public void | discoverGraph(Directed g) Action taken upon beginning to visit the graph. | public void | discoverVertex(Vertex vtx) Action taken upon beginning to visit a graph vertex. | public void | finishEdge(Edge e) Action taken before departing an edge. | public void | finishGraph(Directed g) Finish the graph. | public void | finishVertex(Vertex vtx) Action taken before leaving a vertex in the graph. | public CodeExceptionGen[] | getCEGs(CatchData[] cd) Given an array of exception handler descriptions, return an
array of CodeExceptionGen. | public InstructionList | getInstructionList() Get the instruction list after completing walking the graph,
that is, after calling visit. |
BytecodeCollector | public BytecodeCollector()(Code) | | No-arg constructor.
|
discoverEdge | public void discoverEdge(Edge e)(Code) | | Action taken upon first encountering an edge.
Parameters: e - A FlowControlEdge, a weighted, directed edge. |
discoverGraph | public void discoverGraph(Directed g)(Code) | | Action taken upon beginning to visit the graph.
Parameters: g - Directed graph to be visited. |
discoverVertex | public void discoverVertex(Vertex vtx)(Code) | | Action taken upon beginning to visit a graph vertex. Unless
this is an Entry or Exit vertex, save the starting position in
the bytecode to give a offset for edges with this vertex as target.
Save the end instruction in the bytecode so that we can insert any
connector code their later, in finishVertex.
Entry and Exit vertices carry no bytecode and never have a
connecting instruction, so they can be ignored when collecting
code.
Parameters: v - The vertex; carries a block of code and a finalinstruction in its Connector. |
finishEdge | public void finishEdge(Edge e)(Code) | | Action taken before departing an edge.
Parameters: e - The control flow graph edge. |
finishGraph | public void finishGraph(Directed g)(Code) | | Finish the graph.
Parameters: g - The control flow graph - ignored. |
finishVertex | public void finishVertex(Vertex vtx)(Code) | | Action taken before leaving a vertex in the graph. The
connection instruction, if any, is fixed up by setting
its target(s).
If the connection instruction is a goto, which might jump
into another graph, fixup is delayed until the user asks
for the instruction list, when the processing of all graphs
has been completed.
See Also: CodeVertex.getInstructionList Parameters: v - The vertex, either an Entry or Exit vertex, or acode vertex. |
getCEGs | public CodeExceptionGen[] getCEGs(CatchData[] cd)(Code) | | Given an array of exception handler descriptions, return an
array of CodeExceptionGen. The array may be empty.
XXX This method has not been thoroughly tested.
Parameters: cd - Array of exception handler descriptions in terms of vertices Array of BCEL exception handler structures. |
getInstructionList | public InstructionList getInstructionList()(Code) | | Get the instruction list after completing walking the graph,
that is, after calling visit.
A reference to the bytecode generated by walkingthe control flow graph. |
|
|