harpoon.Interpret.Tree
Class DefaultFrame

java.lang.Object
  extended by harpoon.Backend.Generic.Frame
      extended by harpoon.Interpret.Tree.DefaultFrame
All Implemented Interfaces:
Serializable

public class DefaultFrame
extends Frame

The DefaultFrame class implements the abstract methods of the Frame class. It is intended mostly for testing purposes, and will have to be fixed up a bit if needed for general use.

Version:
$Id: DefaultFrame.java,v 1.4 2002/04/10 03:05:56 cananian Exp $
Author:
Duncan Bryce <duncan@lcs.mit.edu>
See Also:
Serialized Form

Constructor Summary
DefaultFrame(HMethod main, ClassHierarchy ch, harpoon.Interpret.Tree.OffsetMap map, harpoon.Interpret.Tree.AllocationStrategy st)
           
 
Method Summary
 Label exitOutOfMemory()
          Returns the label of a function which exits with an out of memory error
 Label GC()
          Returns the label of the garbage collection function
 HCodeFactory getCodeFactory(HCodeFactory hcf)
          Returns a code factory for machine-specific IR.Assems, given a code factory for CanonicalTreeCode.
 CodeGen getCodeGen()
          Not implemented.
 GCInfo getGCInfo()
          There are no plans to ever have the Tree interpreter support GCInfo, so getGCInfo will always return null.
 InstrBuilder getInstrBuilder()
          Stub added by FSK.
 Linker getLinker()
          The Linker object to use when compiling for this Frame.
 LocationFactory getLocationFactory()
          Stub added by CSA.
 Temp getMemLimit()
          Returns a pointer to the highest available address in memory.
 Temp getNextPtr()
          Returns a pointer to the next free address in memory
 harpoon.Interpret.Tree.OffsetMap getOffsetMap()
           
 RegFileInfo getRegFileInfo()
          Stub added by FSK.
 Runtime getRuntime()
          Returns the appropriate Generic.Runtime for this Frame.
 TempBuilder getTempBuilder()
          Stub added by FSK.
 Exp memAlloc(Exp size)
          Returns a Tree.Exp object which represents a pointer to a newly allocated block of memory, of the specified size.
 boolean pointersAreLong()
          Returns false if pointers can be represented in 32 bits, or true otherwise.
 Instr procAssemDirectives(Instr body)
           
 Instr procLiveOnExit(Instr body)
           
 Stm procPrologue(TreeFactory tf, HCodeElement src, Temp[] paramdsts, int[] paramtypes)
           
 TempFactory tempFactory()
           
 
Methods inherited from class harpoon.Backend.Generic.Frame
setCallGraph, setClassHierarchy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultFrame

public DefaultFrame(HMethod main,
                    ClassHierarchy ch,
                    harpoon.Interpret.Tree.OffsetMap map,
                    harpoon.Interpret.Tree.AllocationStrategy st)
Method Detail

getLinker

public Linker getLinker()
Description copied from class: Frame
The Linker object to use when compiling for this Frame.

Specified by:
getLinker in class Frame

memAlloc

public Exp memAlloc(Exp size)
Returns a Tree.Exp object which represents a pointer to a newly allocated block of memory, of the specified size. Generates code to handle garbage collection, and OutOfMemory errors.


getOffsetMap

public harpoon.Interpret.Tree.OffsetMap getOffsetMap()

getRuntime

public Runtime getRuntime()
Description copied from class: Frame
Returns the appropriate Generic.Runtime for this Frame.

Specified by:
getRuntime in class Frame

pointersAreLong

public boolean pointersAreLong()
Description copied from class: Frame
Returns false if pointers can be represented in 32 bits, or true otherwise.

Specified by:
pointersAreLong in class Frame

tempFactory

public TempFactory tempFactory()

procPrologue

public Stm procPrologue(TreeFactory tf,
                        HCodeElement src,
                        Temp[] paramdsts,
                        int[] paramtypes)

procLiveOnExit

public Instr procLiveOnExit(Instr body)

procAssemDirectives

public Instr procAssemDirectives(Instr body)

exitOutOfMemory

public Label exitOutOfMemory()
Returns the label of a function which exits with an out of memory error


GC

public Label GC()
Returns the label of the garbage collection function


getMemLimit

public Temp getMemLimit()
Returns a pointer to the highest available address in memory.


getNextPtr

public Temp getNextPtr()
Returns a pointer to the next free address in memory


getCodeGen

public CodeGen getCodeGen()
Not implemented.

Specified by:
getCodeGen in class Frame

getInstrBuilder

public InstrBuilder getInstrBuilder()
Stub added by FSK.

Specified by:
getInstrBuilder in class Frame

getTempBuilder

public TempBuilder getTempBuilder()
Stub added by FSK.

Specified by:
getTempBuilder in class Frame

getLocationFactory

public LocationFactory getLocationFactory()
Stub added by CSA.

Specified by:
getLocationFactory in class Frame

getRegFileInfo

public RegFileInfo getRegFileInfo()
Stub added by FSK.

Specified by:
getRegFileInfo in class Frame

getGCInfo

public GCInfo getGCInfo()
There are no plans to ever have the Tree interpreter support GCInfo, so getGCInfo will always return null.

Specified by:
getGCInfo in class Frame

getCodeFactory

public HCodeFactory getCodeFactory(HCodeFactory hcf)
Description copied from class: Frame
Returns a code factory for machine-specific IR.Assems, given a code factory for CanonicalTreeCode. Uses the code generator defined by this frame. Returns null if this frame does not have a code factory that generates IR.Assem.Instrs.

Specified by:
getCodeFactory in class Frame