harpoon.Backend.Sparc
Class RegFileInfo

java.lang.Object
  extended by harpoon.Backend.Generic.RegFileInfo
      extended by harpoon.Backend.Sparc.RegFileInfo
All Implemented Interfaces:
LocationFactory, Serializable

public class RegFileInfo
extends RegFileInfo
implements LocationFactory

RegFileInfo contains architecture specific information about the registers for the Sparc architecture. It also implements the LocationFactory interface for allocating and tracking registers which are used for tracking global data.

Version:
$Id: RegFileInfo.java,v 1.5 2004/02/08 01:57:50 cananian Exp $
Author:
Andrew Berkheimer <andyb@mit.edu>
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class harpoon.Backend.Generic.RegFileInfo
RegFileInfo.CommonLoc, RegFileInfo.MachineRegLoc, RegFileInfo.SpillException, RegFileInfo.StackOffsetLoc, RegFileInfo.TempLocator
 
Nested classes/interfaces inherited from interface harpoon.Backend.Generic.LocationFactory
LocationFactory.Location
 
Constructor Summary
RegFileInfo(TempBuilder tb)
           
 
Method Summary
 LocationFactory.Location allocateLocation(int type)
          Allocate a global location of the specified type and return a handle to it.
 Set calleeSave()
           
 Set callerSave()
           
 Temp[] getAllRegisters()
          Returns an array of Temps which represent all the available registers on the machine.
 Temp[] getGeneralRegisters()
          Returns an array of Temps for all the registers that the register allocator can feel free to play with
 Temp getRegister(int index)
          Returns a specific register on the machine.
 boolean isRegister(Temp t)
          Checks if t is a element of the register file for this architecture.
 Set liveOnExit()
          Returns the Set of registers live at a method's exit.
 HData makeLocationData(Frame f)
          Create an HData object that allocates static space for any allocated locations which need it.
 TempFactory regTempFactory()
           
 Iterator suggestRegAssignment(Temp t, Map regFile)
           
 
Methods inherited from class harpoon.Backend.Generic.RegFileInfo
allRegs, assignment, expand, getAllRegistersC, getGeneralRegistersC, getRegAssignments, illegal, maxRegIndex, occupancy, pressure, suggestRegAssignment
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RegFileInfo

public RegFileInfo(TempBuilder tb)
Method Detail

liveOnExit

public Set liveOnExit()
Description copied from class: RegFileInfo
Returns the Set of registers live at a method's exit.
effects: Returns an unmodifiable Set of register Temps of the registers that should be considered live at the end of a method.

Specified by:
liveOnExit in class RegFileInfo

callerSave

public Set callerSave()

calleeSave

public Set calleeSave()

regTempFactory

public TempFactory regTempFactory()

isRegister

public boolean isRegister(Temp t)
Description copied from class: RegFileInfo
Checks if t is a element of the register file for this architecture.
effects: If t is an element of the register file, Then returns true, Else returns false.

Specified by:
isRegister in class RegFileInfo
Parameters:
t - Temp that may be part of the register file.

suggestRegAssignment

public Iterator suggestRegAssignment(Temp t,
                                     Map regFile)
                              throws RegFileInfo.SpillException
Throws:
RegFileInfo.SpillException

getAllRegisters

public Temp[] getAllRegisters()
Description copied from class: RegFileInfo
Returns an array of Temps which represent all the available registers on the machine.

Specified by:
getAllRegisters in class RegFileInfo

getRegister

public Temp getRegister(int index)
Description copied from class: RegFileInfo
Returns a specific register on the machine.
getRegister(index)==getAllRegisters()[index]

Overrides:
getRegister in class RegFileInfo

getGeneralRegisters

public Temp[] getGeneralRegisters()
Description copied from class: RegFileInfo
Returns an array of Temps for all the registers that the register allocator can feel free to play with

Specified by:
getGeneralRegisters in class RegFileInfo

allocateLocation

public LocationFactory.Location allocateLocation(int type)
Description copied from interface: LocationFactory
Allocate a global location of the specified type and return a handle to it. This method may not be called after makeLocationData() has been invoked. It is suggested that this constraint is checked in any implementation using a boolean flag to help ensure correctness.

Specified by:
allocateLocation in interface LocationFactory
Parameters:
type - a IR.Tree.Type specifying the type of location to allocate.

makeLocationData

public HData makeLocationData(Frame f)
Description copied from interface: LocationFactory
Create an HData object that allocates static space for any allocated locations which need it. The allocateLocation method may not be called after this method has been invoked.

Specified by:
makeLocationData in interface LocationFactory
Parameters:
f - the Generic.Frame to which the HData will belong.