harpoon.IR.Tree
Class TreeCode

java.lang.Object
  extended by harpoon.ClassFile.HCode<Tree>
      extended by harpoon.IR.Tree.Code
          extended by harpoon.IR.Tree.TreeCode
Direct Known Subclasses:
StubCode

public class TreeCode
extends Code


Nested Class Summary
 
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
          The getName() method return codename, which is "tree" for this Code.
 
Fields inherited from class harpoon.IR.Tree.Code
frame, parent, tf, tree
 
Constructor Summary
protected TreeCode(HMethod newMethod, Tree tree, Frame topframe, TreeDerivation treeDerivation)
           
 
Method Summary
 HCodeAndMaps<Tree> clone(HMethod newMethod, Frame frame)
          Clone this code representation.
static HCodeFactory codeFactory(Frame frame)
          Return a code factory for TreeCode, using the default code factory for LowQuadSSI
static HCodeFactory codeFactory(HCodeFactory hcf, Frame frame)
          Returns a code factory for TreeCode, given a code factory for LowQuadNoSSA or LowQuadSSI.
 CFGrapher<Tree> getGrapher()
          CFGrapher not valid for non-canonical trees.
 String getName()
          Return the name of this code view.
 TreeDerivation getTreeDerivation()
           
 UseDefer<Tree> getUseDefer()
          UseDefer not valid for non-canonical trees.
 boolean isCanonical()
          Returns true if this codeview is a canonical representation
 void recomputeEdges()
          This operation is not supported in non-canonical tree forms.
 
Methods inherited from class harpoon.IR.Tree.Code
clone, cloneHelper, elementArrayFactory, getElements, getElementsI, getFrame, getLeafElements, getMethod, getRootElement, 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
The getName() method return codename, which is "tree" for this Code.

See Also:
Constant Field Values
Constructor Detail

TreeCode

protected TreeCode(HMethod newMethod,
                   Tree tree,
                   Frame topframe,
                   TreeDerivation treeDerivation)
Method Detail

getTreeDerivation

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

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 "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:
false

getGrapher

public CFGrapher<Tree> getGrapher()
CFGrapher not valid for non-canonical trees.

Overrides:
getGrapher in class Code
Returns:
null

getUseDefer

public UseDefer<Tree> getUseDefer()
UseDefer not valid for non-canonical trees.

Overrides:
getUseDefer in class Code
Returns:
null

recomputeEdges

public void recomputeEdges()
This operation is not supported in non-canonical tree forms.

Throws:
UnsupportedOperationException - always.

codeFactory

public static HCodeFactory codeFactory(HCodeFactory hcf,
                                       Frame frame)
Returns a code factory for TreeCode, given a code factory for LowQuadNoSSA or LowQuadSSI.
effects: if hcf is a code factory for LowQuadNoSSA or LowQuadSSI, then creates and returns a code factory for TreeCode. Else passes hcf to LowQuadSSI.codeFactory(), and reattempts to create a code factory for TreeCode from the code factory returned by LowQuadSSI.

See Also:
LowQuadSSI.codeFactory(HCodeFactory)

codeFactory

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