|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mmtk.utility.heap.SpaceDescriptor
public class SpaceDescriptor
This class manages the encoding and decoding of space descriptors.
Space descriptors are integers that encode a space's mapping into virtual memory. For discontiguous spaces, they indicate discontiguity and mapping must be done by consulting the space map. For contiguous spaces, the space's address range is encoded into the integer (using a fixed point notation).
The purpose of this class is to allow static final int
space descriptors to exist for each space, which can then be used
in tests to determine whether an object is in a space. A good
compiler can perform this decoding at compile time and produce
optimal code for the test.
Field Summary | |
---|---|
private static int |
BASE_EXPONENT
|
private static int |
DISCONTIG_INDEX_INCREMENT
|
private static int |
discontiguousSpaceIndex
|
private static int |
EXPONENT_BITS
|
private static int |
EXPONENT_MASK
|
private static int |
EXPONENT_SHIFT
|
private static int |
MANTISSA_BITS
|
private static int |
MANTISSA_SHIFT
|
private static int |
SIZE_BITS
|
private static int |
SIZE_MASK
|
private static int |
SIZE_SHIFT
|
private static int |
TYPE_BITS
|
private static int |
TYPE_CONTIGUOUS
|
private static int |
TYPE_CONTIGUOUS_HI
|
private static int |
TYPE_MASK
|
private static int |
TYPE_SHARED
|
Constructor Summary | |
---|---|
SpaceDescriptor()
|
Method Summary | |
---|---|
static int |
createDescriptor()
Create a descriptor for a dis-contiguous (shared) space |
static int |
createDescriptor(Address start,
Address end)
Create a descriptor for a contiguous space |
static int |
getChunks(int descriptor)
Return the size of the region of memory encoded in this descriptor, in chunks |
static Address |
getStart(int descriptor)
Return the start of this region of memory encoded in this descriptor |
static boolean |
isContiguous(int descriptor)
Return true if this descriptor describes a contiguous space |
static boolean |
isContiguousHi(int descriptor)
Return true if this descriptor describes a contiguous space that is at the top of the virtual address space |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final int TYPE_BITS
private static final int TYPE_SHARED
private static final int TYPE_CONTIGUOUS
private static final int TYPE_CONTIGUOUS_HI
private static final int TYPE_MASK
private static final int SIZE_SHIFT
private static final int SIZE_BITS
private static final int SIZE_MASK
private static final int EXPONENT_SHIFT
private static final int EXPONENT_BITS
private static final int EXPONENT_MASK
private static final int MANTISSA_SHIFT
private static final int MANTISSA_BITS
private static final int BASE_EXPONENT
private static int discontiguousSpaceIndex
private static final int DISCONTIG_INDEX_INCREMENT
Constructor Detail |
---|
public SpaceDescriptor()
Method Detail |
---|
public static int createDescriptor(Address start, Address end)
start
- The start address of the spaceend
- The end address of the space
public static int createDescriptor()
public static boolean isContiguous(int descriptor)
descriptor
-
true
if this descriptor describes a contiguous spacepublic static boolean isContiguousHi(int descriptor)
descriptor
-
true
if this descriptor describes a contiguous space that
is at the top of the virtual address spacepublic static Address getStart(int descriptor)
descriptor
-
public static int getChunks(int descriptor)
descriptor
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |