harpoon.Backend.Generic
Interface LocationFactory

All Superinterfaces:
Serializable
All Known Implementing Classes:
RegFileInfo, RegFileInfo, RegFileInfo

public interface LocationFactory
extends Serializable

The LocationFactory interface provides a means for the runtime system to get access to some global storage for its use. For example, the memory manager may might to store pointer to the current top-of-heap and top-of-memory in some place accessible by every method. The locations returned may be global registers (in which case the Generic.LocationFactory must coordinate with Generic.RegFileInfo to ensure those registers are not used for other purposes by the register allocator) or static locations in memory (useful on register-constrained machines). If static storage is allocated, the makeLocationData() method will generate an HData containing a label and the appropriate declaration for the storage; otherwise it will return an empty HData.

Version:
$Id: LocationFactory.java,v 1.3 2003/04/19 01:03:44 salcianu Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Nested Class Summary
static interface LocationFactory.Location
          The Locations returned by the LocationFactory allocation function are opaque data structures that permit only the creation of an accessor fragment in Tree form.
 
Method Summary
 LocationFactory.Location allocateLocation(int type)
          Allocate a global location of the specified type and return a handle to it.
 HData makeLocationData(Frame f)
          Create an HData object that allocates static space for any allocated locations which need it.
 

Method Detail

allocateLocation

LocationFactory.Location allocateLocation(int type)
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.

Parameters:
type - a IR.Tree.Type specifying the type of location to allocate.

makeLocationData

HData makeLocationData(Frame f)
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.

Parameters:
f - the Generic.Frame to which the HData will belong.