at.dms.backend
Class TreeWalker
java.lang.Object
|
+--at.dms.backend.TreeWalker
- Direct Known Subclasses:
- DeadcodeElimination, PeepholeOptimizer, RegisterAllocation, StackScheduler
- public abstract class TreeWalker
- extends java.lang.Object
This is the an abstract class to walk across the tree. (DFS)
Methods inherited from class java.lang.Object |
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TreeWalker
public TreeWalker(BasicBlock[] bblocks,
BasicBlock[] eblocks)
- Creates a new instruction handle.
- Parameters:
instruction
- The instruction.prev
- The handle of the next instruction in textual order.
traverse
protected void traverse()
- Runs the deadcode algorithm.
getBasicBlock
protected BasicBlock getBasicBlock(int which)
processNode
protected abstract void processNode(QNode node)
- Processes the node.
- Parameters:
node
- The node to be processed.
kill
protected void kill()
- Called when a branch is reached.
removeNode
protected void removeNode(QNode node)
- Removes the specified node.