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)


Constructor Summary
TreeWalker(BasicBlock[] bblocks, BasicBlock[] eblocks)
          Creates a new instruction handle.
 
Method Summary
protected  BasicBlock getBasicBlock(int which)
           
protected  void kill()
          Called when a branch is reached.
protected abstract  void processNode(QNode node)
          Processes the node.
protected  void removeNode(QNode node)
          Removes the specified node.
protected  void traverse()
          Runs the deadcode algorithm.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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.
Method Detail

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.