Modifier and Type | Field and Description |
---|---|
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
Number of chunks that can be mmapped, 64bit work around allowing 8GB
of addressable memory
|
static byte |
PROTECTED |
static byte |
UNMAPPED |
static boolean |
verbose |
Constructor and Description |
---|
Mmapper() |
Modifier and Type | Method and Description |
---|---|
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).
|
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
private static final byte[] mapped
public Mmapper()
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 mmappedaddr
- The address in question.true
if the given address has been mmappedpublic static boolean objectIsMapped(ObjectReference object)
true
if the given object has been mmappedobject
- The object in question.true
if the given object has been mmappedprivate static Address chunkAlignUp(Address addr)
addr
- The address to be alignedprivate static Address chunkAlignDown(Address addr)
addr
- The address to be aligned