|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object scale.backend.SpaceAllocation
public class SpaceAllocation
This class represents statically allocated memory.
$Id: SpaceAllocation.java,v 1.27 2007-10-04 19:57:49 burrill Exp $
Copyright 2008 by the
Scale Compiler Group,
Department of Computer Science
University of Massachusetts,
Amherst MA. 01003, USA
All Rights Reserved.
Typically memory is statically allocated in different areas or sections. Different systems use different rules for what can be allocated where. One section might be for addresses and another for floating point values. There is typically one area for un-initialized memory. An instance of this class represents an individually statically allocated chunk of memory. This chunk is allocated in an area and has a size. It may also have a set of values to be used to statically initialize it.
Field Summary | |
---|---|
static int |
DAT_ADDRESS
The data area initializer contains address data. |
static int |
DAT_BYTE
The data area initializer contains 8-bit integers. |
static int |
DAT_DBL
The data area initializer contains 64-bit floating point values. |
static int |
DAT_FLT
The data area initializer contains 32-bit floating point values. |
static int |
DAT_INT
The data area initializer contains 32-bit integer values. |
static int |
DAT_LDBL
The data area initializer contains 64-bit floating point values. |
static int |
DAT_LONG
The data area initializer contains 64-bit integer values. |
static int |
DAT_NONE
The data area is not initialized. |
static int |
DAT_SHORT
The data area initializer 16-bit integer. |
static int |
DAT_TEXT
The data area initializer contains instructions. |
static byte |
DAV_EXTERN
The memory is in another module. |
static byte |
DAV_GLOBAL
The memory has global visibility. |
static byte |
DAV_LOCAL
The memory has local visibility. |
static java.lang.String[] |
types
Map from data type to displayable name. |
static java.lang.String[] |
visibilities
map from visibility to displayable name. |
Constructor Summary | |
---|---|
SpaceAllocation(java.lang.String name,
int area,
int type,
boolean readOnly,
long size,
int reps,
int alignment,
java.lang.Object value)
Create an object to represent static allocation of memory. |
|
SpaceAllocation(java.lang.String name,
int area,
int type,
boolean readOnly,
long size,
int reps,
java.lang.Object value)
Create an object to represent static allocation of memory. |
|
SpaceAllocation(java.lang.String name,
int area,
int type,
boolean readOnly,
long size,
java.lang.Object value)
Create an object to represent static allocation of memory. |
Method Summary | |
---|---|
boolean |
containsAddress()
Return true if the memory is initialized with address data. |
boolean |
containsData()
Return true if the memory is initialized. |
int |
getAlignment()
Return the alignment boundary required. |
int |
getArea()
Return the index of the area in which this memory is allocated. |
Displacement |
getDisplacement()
Return the displacement associated with this space allocation or null |
java.lang.String |
getName()
Return the name of the memory area. |
int |
getReps()
Return the number of times the value is repeated. |
long |
getSize()
Return the size of the memory in bytes. |
int |
getType()
Return the type of data this memory contains. |
java.lang.Object |
getValue()
Return the initilizer. |
int |
getVisibility()
Return the visibility of the memory. |
boolean |
isWeak()
Return true if the area is weakly linked. |
boolean |
matches(int area,
int type,
long size,
boolean readOnly)
Return true if this space allocation has the specified attributes. |
boolean |
readOnly()
Return true if the memory is read-only. |
protected void |
setAlignment(int alignment)
Set the alignment boundary required. |
void |
setDisplacement(Displacement disp)
Associate the displacement with this space allocation. |
void |
setValue(java.lang.Object value)
Set the initilizer |
void |
setVisibility(byte visibility)
Set the visibility of the memory area. |
void |
setWeak(boolean weak)
Specify if the symbol is weakly linked.. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DAT_NONE
public static final int DAT_BYTE
public static final int DAT_SHORT
public static final int DAT_INT
public static final int DAT_LONG
public static final int DAT_FLT
public static final int DAT_DBL
public static final int DAT_ADDRESS
public static final int DAT_TEXT
public static final int DAT_LDBL
public static final java.lang.String[] types
public static final byte DAV_LOCAL
public static final byte DAV_GLOBAL
public static final byte DAV_EXTERN
public static final java.lang.String[] visibilities
Constructor Detail |
---|
public SpaceAllocation(java.lang.String name, int area, int type, boolean readOnly, long size, java.lang.Object value)
name
- is the name of the allocated memoryarea
- is the area (section) in which the memory is allocatedtype
- specifies what the memory holdsreadOnly
- is true if the area is read-onlysize
- specifies the size of the memory in addressable unitsvalue
- specifies the object used to generate the
initialization for the memory areapublic SpaceAllocation(java.lang.String name, int area, int type, boolean readOnly, long size, int reps, java.lang.Object value)
name
- is the name of the allocated memoryarea
- is the area (section) in which the memory is allocatedtype
- specifies what the memory holdsreadOnly
- is true if the area is read-onlysize
- specifies the size of the memory or data item in
addressable unitsreps
- specifies the number of times the value is repeatedvalue
- specifies the object used to generate the
initialization for the memory areapublic SpaceAllocation(java.lang.String name, int area, int type, boolean readOnly, long size, int reps, int alignment, java.lang.Object value)
name
- is the name of the allocated memoryarea
- is the area (section) in which the memory is allocatedtype
- specifies what the memory holdsreadOnly
- is true if the area is read-onlysize
- specifies the size of the memory or data item in
addressable unitsreps
- specifies the number of times the value is repeatedalignment
- specifies the memory boundary to align the data onvalue
- specifies the object used to generate the
initialization for the memory areaMethod Detail |
---|
public void setDisplacement(Displacement disp)
public Displacement getDisplacement()
null
public boolean matches(int area, int type, long size, boolean readOnly)
area
- specifies the section in which the loader should place the areatype
- specifies the type of datasize
- is the number of addressable units requiredreadOnly
- is true if the area is read-onlypublic boolean readOnly()
public boolean containsData()
public boolean containsAddress()
public void setVisibility(byte visibility)
public int getVisibility()
public boolean isWeak()
public void setWeak(boolean weak)
public java.lang.Object getValue()
public void setValue(java.lang.Object value)
public java.lang.String getName()
public int getArea()
public long getSize()
public int getReps()
protected void setAlignment(int alignment)
public int getAlignment()
public int getType()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |