|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object joeq.Compiler.Quad.ControlFlowGraph
public class ControlFlowGraph
Control flow graph for the Quad format. The control flow graph is a fundamental part of the quad intermediate representation. The control flow graph organizes the basic blocks for a method. Control flow graphs always include an entry basic block and an exit basic block. These basic blocks are always empty and have id numbers 0 and 1, respectively. A control flow graph includes references to the entry and exit nodes, and the set of exception handlers for the method.
Field Summary | |
---|---|
static Map |
correspondenceMap
Merges the given control flow graph into this control flow graph. |
Constructor Summary | |
---|---|
ControlFlowGraph(jq_Method method,
int numOfExits,
int numOfExceptionHandlers,
RegisterFactory rf)
Creates a new ControlFlowGraph. |
Method Summary | |
---|---|
void |
addJSRInfo(JSRInfo info)
|
void |
appendExceptionHandlers(ExceptionHandlerList ehl)
|
BasicBlock |
createBasicBlock(int numOfPredecessors,
int numOfSuccessors,
int numOfInstructions,
ExceptionHandlerList ehs)
Create a new basic block in this control flow graph. |
BasicBlock |
entry()
Returns the entry node. |
BasicBlock |
exit()
Returns the exit node. |
String |
fullDump()
Returns a verbose string of every basic block in this control flow graph. |
List.ExceptionHandler |
getExceptionHandlers()
Return the list of exception handlers in this control flow graph. |
Iterator |
getExceptionHandlersMatchingEntry(BasicBlock b)
Return an iterator of the exception handlers with the given entry point. |
JSRInfo |
getJSRInfo(BasicBlock bb)
|
int |
getMaxQuadID()
Returns the maximum id number for a quad. |
jq_Method |
getMethod()
Returns the method this control flow graph represents. |
jwutil.graphs.Navigator |
getNavigator()
|
int |
getNewQuadID()
Returns a new id number for a quad. |
int |
getNumberOfBasicBlocks()
Returns a maximum on the number of basic blocks in this control flow graph. |
int |
getNumberOfQuads()
|
RegisterFactory |
getRegisterFactory()
Returns the register factory used by this control flow graph. |
Collection |
getRoots()
|
ControlFlowGraph |
merge(ControlFlowGraph from)
|
List.BasicBlock |
postOrderOnReverseGraph(BasicBlock start_bb)
Returns a list of basic blocks of the reversed graph in post order, starting at the given basic block. |
ListIterator.BasicBlock |
postOrderOnReverseGraphIterator()
Returns an iteration of the basic blocks in the reversed graph in post order. |
boolean |
removeUnreachableBasicBlocks()
|
List.BasicBlock |
reversePostOrder(BasicBlock start_bb)
Returns a list of basic blocks in reverse post order, starting at the given basic block. |
ListIterator.BasicBlock |
reversePostOrderIterator()
Returns an iteration of the basic blocks in this graph in reverse post order. |
ListIterator.BasicBlock |
reversePostOrderIterator(BasicBlock start_bb)
Returns an iteration of the basic blocks in this graph reachable from the given basic block in reverse post order, starting from the given basic block. |
List.BasicBlock |
reversePostOrderOnReverseGraph(BasicBlock start_bb)
Returns a list of basic blocks of the reversed graph in reverse post order, starting at the given basic block. |
ListIterator.BasicBlock |
reversePostOrderOnReverseGraphIterator()
Returns an iteration of the basic blocks in the reversed graph in reverse post order. |
void |
visitBasicBlocks(BasicBlockVisitor bbv)
Visits all of the basic blocks in this graph with the given visitor. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static Map correspondenceMap
Constructor Detail |
---|
public ControlFlowGraph(jq_Method method, int numOfExits, int numOfExceptionHandlers, RegisterFactory rf)
numOfExits
- the expected number of branches to the exit node.numOfExceptionHandlers
- the expected number of exception handlers.Method Detail |
---|
public BasicBlock entry()
public BasicBlock exit()
public jq_Method getMethod()
public RegisterFactory getRegisterFactory()
public BasicBlock createBasicBlock(int numOfPredecessors, int numOfSuccessors, int numOfInstructions, ExceptionHandlerList ehs)
numOfPredecessors
- number of predecessor basic blocks that this
basic block is expected to have.numOfSuccessors
- number of successor basic blocks that this
basic block is expected to have.numOfInstructions
- number of instructions that this basic block
is expected to have.ehs
- set of exception handlers for this basic block.
public int getNumberOfBasicBlocks()
public int getNumberOfQuads()
public int getNewQuadID()
public int getMaxQuadID()
public void addJSRInfo(JSRInfo info)
public JSRInfo getJSRInfo(BasicBlock bb)
public ListIterator.BasicBlock reversePostOrderIterator()
public ListIterator.BasicBlock reversePostOrderOnReverseGraphIterator()
public ListIterator.BasicBlock postOrderOnReverseGraphIterator()
public ListIterator.BasicBlock reversePostOrderIterator(BasicBlock start_bb)
start_bb
- basic block to start reverse post order from.
public void visitBasicBlocks(BasicBlockVisitor bbv)
bbv
- visitor to visit each basic block with.public List.BasicBlock reversePostOrder(BasicBlock start_bb)
start_bb
- basic block to start from.
public List.BasicBlock reversePostOrderOnReverseGraph(BasicBlock start_bb)
start_bb
- basic block to start from.
public List.BasicBlock postOrderOnReverseGraph(BasicBlock start_bb)
start_bb
- basic block to start from.
public List.ExceptionHandler getExceptionHandlers()
public Iterator getExceptionHandlersMatchingEntry(BasicBlock b)
b
- basic block to check exception handlers against.
public String fullDump()
public ControlFlowGraph merge(ControlFlowGraph from)
public void appendExceptionHandlers(ExceptionHandlerList ehl)
public Collection getRoots()
getRoots
in interface jwutil.graphs.Graph
public jwutil.graphs.Navigator getNavigator()
getNavigator
in interface jwutil.graphs.Graph
public boolean removeUnreachableBasicBlocks()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |