Modifier and Type | Field and Description |
---|---|
private static int |
BOOT_SEGMENT_MB |
private static ImmortalSpace |
bootSpace |
private static int |
LOG_BYTES_IN_PAGE_LIE
A lie about the size of a virtual memory page.
|
Constructor and Description |
---|
Memory() |
Modifier and Type | Method and Description |
---|---|
void |
collectorPrepareVMSpace()
Per-collector preparation for a collection.
|
void |
collectorReleaseVMSpace()
Per-collector post-collection work.
|
void |
dumpMemory(Address start,
int beforeBytes,
int afterBytes)
Logs the contents of an address and the surrounding memory to the
error output.
|
int |
dzmmap(Address start,
int size)
Demand zero mmaps an area of virtual memory.
|
protected int |
getAlignmentValueConstant() |
protected Address |
getAvailableEndConstant() |
protected Address |
getAvailableStartConstant() |
protected Address |
getHeapEndConstant() |
protected Address |
getHeapStartConstant() |
protected byte |
getLogBytesInAddressConstant() |
protected byte |
getLogBytesInPageConstant() |
protected byte |
getLogBytesInWordConstant() |
protected byte |
getLogMinAlignmentConstant() |
protected byte |
getMaxAlignmentShiftConstant()
On Intel we align code to 16 bytes as recommended in the optimization manual.
|
protected int |
getMaxBytesPaddingConstant() |
ImmortalSpace |
getVMSpace()
Return the space associated with/reserved for the VM.
|
void |
globalPrepareVMSpace()
Global preparation for a collection.
|
void |
globalReleaseVMSpace()
Global post-collection work.
|
void |
isync()
Wait for all preceeding instructions to complete and discard any
prefetched instructions on this processor.
|
boolean |
mprotect(Address start,
int size)
Protects access to an area of virtual memory.
|
boolean |
munprotect(Address start,
int size)
Allows access to an area of virtual memory.
|
void |
setHeapRange(int id,
Address start,
Address end)
Sets the range of addresses associated with a heap.
|
void |
sync()
Wait for preceeding cache flush/invalidate instructions to complete
on all processors.
|
void |
zero(boolean useNT,
Address start,
Extent len)
Zero a region of memory.
|
private static final int LOG_BYTES_IN_PAGE_LIE
private static ImmortalSpace bootSpace
private static final int BOOT_SEGMENT_MB
public Memory()
protected final Address getHeapStartConstant()
getHeapStartConstant
in class Memory
protected final Address getHeapEndConstant()
getHeapEndConstant
in class Memory
protected final Address getAvailableStartConstant()
getAvailableStartConstant
in class Memory
protected final Address getAvailableEndConstant()
getAvailableEndConstant
in class Memory
protected final byte getLogBytesInAddressConstant()
getLogBytesInAddressConstant
in class Memory
protected final byte getLogBytesInWordConstant()
getLogBytesInWordConstant
in class Memory
protected final byte getLogBytesInPageConstant()
getLogBytesInPageConstant
in class Memory
protected final byte getLogMinAlignmentConstant()
getLogMinAlignmentConstant
in class Memory
protected final int getMaxBytesPaddingConstant()
getMaxBytesPaddingConstant
in class Memory
protected final int getAlignmentValueConstant()
getAlignmentValueConstant
in class Memory
protected final byte getMaxAlignmentShiftConstant()
getMaxAlignmentShiftConstant
in class Memory
public final ImmortalSpace getVMSpace()
The boot image space must be mapped at the start of available virtual memory, hence we use the constructor that requests the lowest address in the address space. The address space awarded to this space depends on the order in which the request is made. If this request is not the first request for virtual memory then the Space allocator will die with an error stating that the request could not be satisfied. The remedy is to ensure it is initialized first.
getVMSpace
in class Memory
public final void globalPrepareVMSpace()
Memory
globalPrepareVMSpace
in class Memory
public final void collectorPrepareVMSpace()
Memory
collectorPrepareVMSpace
in class Memory
public final void collectorReleaseVMSpace()
Memory
collectorReleaseVMSpace
in class Memory
public final void globalReleaseVMSpace()
Memory
globalReleaseVMSpace
in class Memory
public final void setHeapRange(int id, Address start, Address end)
Memory
setHeapRange
in class Memory
id
- the heap identifierstart
- the address of the start of the heapend
- the address of the end of the heappublic final int dzmmap(Address start, int size)
Memory
public final boolean mprotect(Address start, int size)
Memory
public final boolean munprotect(Address start, int size)
Memory
munprotect
in class Memory
start
- the address of the start of the area to be mappedsize
- the size, in bytes, of the area to be mappedtrue
if successful, otherwise
false
public final void zero(boolean useNT, Address start, Extent len)
Memory
public final void dumpMemory(Address start, int beforeBytes, int afterBytes)
Memory
dumpMemory
in class Memory
start
- the address of the memory to be dumpedbeforeBytes
- the number of bytes before the address to be
includedafterBytes
- the number of bytes after the address to be
includedpublic final void sync()
Memory