JML

org.multijava.util.backend
Class TreeWalker

java.lang.Object
  extended byorg.multijava.util.backend.TreeWalker
Direct Known Subclasses:
DeadcodeElimination, RegisterAllocation, StackSchleduler

public abstract class TreeWalker
extends Object

This is the an abstract class to walk across the tree (DFS)


Field Summary
private  BasicBlock[] bblocks
           
private  BasicBlock currentBlock
           
private  BasicBlock[] eblocks
           
 
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
private  void traverseInstructions(BasicBlock block)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentBlock

private BasicBlock currentBlock

bblocks

private BasicBlock[] bblocks

eblocks

private BasicBlock[] eblocks
Constructor Detail

TreeWalker

public TreeWalker(BasicBlock[] bblocks,
                  BasicBlock[] eblocks)
Creates a new instruction handle.

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


traverseInstructions

private void traverseInstructions(BasicBlock block)

JML

JML is Copyright (C) 1998-2002 by Iowa State University and is distributed under the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This release depends on code from the MultiJava project and is based in part on the Kopi project Copyright (C) 1990-99 DMS Decision Management Systems Ges.m.b.H.