harpoon.IR.Tree
Class OptimizedTreeCode

java.lang.Object
  extended by harpoon.ClassFile.HCode<Tree>
      extended by harpoon.IR.Tree.Code
          extended by harpoon.IR.Tree.OptimizedTreeCode

public class OptimizedTreeCode
extends Code

The OptimizedTreeCode codeview is an optimized, canonical representation of Tree form. It provides a code factory that will generate tree code optimized with a set of standard passes, and a code factory that allows for specifying your own set of optimization passes.

Version:
$Id: OptimizedTreeCode.java,v 1.4 2003/03/11 17:24:56 cananian Exp $
Author:
Duncan Bryce <duncan@lcs.mit.edu>

Nested Class Summary
static interface OptimizedTreeCode.TreeOptimizer
           
 
Nested classes/interfaces inherited from class harpoon.IR.Tree.Code
Code.TreeFactory
 
Nested classes/interfaces inherited from class harpoon.ClassFile.HCode
HCode.PrintCallback<HCE extends HCodeElement>
 
Field Summary
static String codename
           
 
Fields inherited from class harpoon.IR.Tree.Code
frame, parent, tf, tree
 
Method Summary
 HCodeAndMaps<Tree> clone(HMethod newMethod, Frame frame)
          Clone this code representation.
static HCodeFactory codeFactory(Frame frame)
          Return a code factory for LowQuadNoSSA, using the default code factory for LowQuadNoSSA
static HCodeFactory codeFactory(HCodeFactory hcf, Frame frame)
          Return a code factory for OptimizedTreeCode, given a code factory for CanonicalTreeCode.
static HCodeFactory codeFactory(HCodeFactory hcf, Frame frame, OptimizedTreeCode.TreeOptimizer[] topts)
          Return a code factory for OptimizedTreeCode, given a code factory for CanonicalTreeCode, a Frame, and a set of optimizations to perform.
 String getName()
          Return the name of this code view.
 TreeDerivation getTreeDerivation()
           
 boolean isCanonical()
          Returns true if this codeview is a canonical representation
 
Methods inherited from class harpoon.IR.Tree.Code
clone, cloneHelper, elementArrayFactory, getElements, getElementsI, getFrame, getGrapher, getLeafElements, getMethod, getRootElement, getUseDefer, print, remove
 
Methods inherited from class harpoon.ClassFile.HCode
clone, elementIndexer, getElementsL, print, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

codename

public static final String codename
See Also:
Constant Field Values
Method Detail

clone

public HCodeAndMaps<Tree> clone(HMethod newMethod,
                                Frame frame)
Clone this code representation. The clone has its own copy of the tree structure.

Specified by:
clone in class Code

getName

public String getName()
Return the name of this code view.

Specified by:
getName in class Code
Returns:
the string "canonical-tree".

isCanonical

public boolean isCanonical()
Description copied from class: Code
Returns true if this codeview is a canonical representation

Specified by:
isCanonical in class Code
Returns:
true

codeFactory

public static HCodeFactory codeFactory(HCodeFactory hcf,
                                       Frame frame)
Return a code factory for OptimizedTreeCode, given a code factory for CanonicalTreeCode. This code factory performs a standard set of optimizations on the CanonicalTreeCode.


codeFactory

public static HCodeFactory codeFactory(HCodeFactory hcf,
                                       Frame frame,
                                       OptimizedTreeCode.TreeOptimizer[] topts)
Return a code factory for OptimizedTreeCode, given a code factory for CanonicalTreeCode, a Frame, and a set of optimizations to perform.


codeFactory

public static HCodeFactory codeFactory(Frame frame)
Return a code factory for LowQuadNoSSA, using the default code factory for LowQuadNoSSA


getTreeDerivation

public TreeDerivation getTreeDerivation()
Specified by:
getTreeDerivation in class Code