|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.mmtk.utility.heap.Mmapper
public final class Mmapper
This class implements mmapping and protection of virtual memory.
Field Summary | |
---|---|
static Lock |
lock
|
static int |
LOG_MMAP_CHUNK_BYTES
|
private static byte[] |
mapped
|
static byte |
MAPPED
|
static int |
MMAP_CHUNK_BYTES
|
private static int |
MMAP_CHUNK_MASK
|
private static int |
MMAP_NUM_CHUNKS
|
static byte |
PROTECTED
|
static byte |
UNMAPPED
|
static boolean |
verbose
|
Constructor Summary | |
---|---|
Mmapper()
|
Method Summary | |
---|---|
static boolean |
addressIsMapped(Address addr)
Return true if the given address has been mmapped |
private static Address |
chunkAlignDown(Address addr)
Return a given address rounded down to an mmap chunk size |
private static Address |
chunkAlignUp(Address addr)
Return a given address rounded up to an mmap chunk size |
static void |
eagerlyMmapAllSpaces(AddressArray spaceMap)
Given an address array describing the regions of virtual memory to be used by MMTk, demand zero map all of them if they are not already mapped. |
static void |
ensureMapped(Address start,
int pages)
Ensure that a range of pages is mmapped (or equivalent). |
static void |
markAsMapped(Address start,
int bytes)
Mark a range of pages as having (already) been mapped. |
static boolean |
objectIsMapped(ObjectReference object)
Return true if the given object has been mmapped |
static void |
protect(Address start,
int pages)
Memory protect a range of pages (using mprotect or equivalent). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte UNMAPPED
public static final byte MAPPED
public static final byte PROTECTED
public static final int LOG_MMAP_CHUNK_BYTES
public static final int MMAP_CHUNK_BYTES
private static final int MMAP_CHUNK_MASK
private static final int MMAP_NUM_CHUNKS
public static final boolean verbose
public static final Lock lock
private static byte[] mapped
Constructor Detail |
---|
public Mmapper()
Method Detail |
---|
public static void eagerlyMmapAllSpaces(AddressArray spaceMap)
spaceMap
- An address array containing a pairs of start and end
addresses for each of the regions to be mappe3dpublic static void markAsMapped(Address start, int bytes)
start
- The start of the range to be marked as mappedbytes
- The size of the range, in bytes.public static void ensureMapped(Address start, int pages)
NOTE: There is a monotonicity assumption so that only updates require lock acquisition. TODO: Fix the above to support unmapping.
start
- The start of the range to be mapped.pages
- The size of the range to be mapped, in pagespublic static void protect(Address start, int pages)
start
- The start of the range to be protected.pages
- The size of the range to be protected, in pagespublic static boolean addressIsMapped(Address addr)
true
if the given address has been mmapped
addr
- The address in question.
true
if the given address has been mmappedpublic static boolean objectIsMapped(ObjectReference object)
true
if the given object has been mmapped
object
- The object in question.
true
if the given object has been mmappedprivate static Address chunkAlignUp(Address addr)
addr
- The address to be aligned
private static Address chunkAlignDown(Address addr)
addr
- The address to be aligned
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |