org.mmtk.policy.immix
Class ChunkList

java.lang.Object
  extended by org.mmtk.policy.immix.ChunkList
All Implemented Interfaces:
Constants

public final class ChunkList
extends Object
implements Constants


Field Summary
private static int CHUNK_MAP_BLOCKS
           
private  AddressArray chunkMap
           
private  int chunkMapCursor
           
private  int chunkMapLimit
           
private static int ENTRIES_IN_CHUNK_MAP_BLOCK
           
private static int LOG_PAGES_IN_CHUNK_MAP_BLOCK
           
private static int MAX_ENTRIES_IN_CHUNK_MAP
           
 
Fields inherited from interface org.mmtk.utility.Constants
ALIGNMENT_VALUE, ARRAY_ELEMENT, BITS_IN_ADDRESS, BITS_IN_BYTE, BITS_IN_CHAR, BITS_IN_INT, BITS_IN_PAGE, BITS_IN_SHORT, BITS_IN_WORD, BYTES_IN_ADDRESS, BYTES_IN_BYTE, BYTES_IN_CHAR, BYTES_IN_INT, BYTES_IN_KBYTE, BYTES_IN_MBYTE, BYTES_IN_PAGE, BYTES_IN_SHORT, BYTES_IN_WORD, CARD_MASK, CARD_META_PAGES_PER_REGION, INSTANCE_FIELD, LOG_BITS_IN_ADDRESS, LOG_BITS_IN_BYTE, LOG_BITS_IN_CHAR, LOG_BITS_IN_INT, LOG_BITS_IN_PAGE, LOG_BITS_IN_SHORT, LOG_BITS_IN_WORD, LOG_BYTES_IN_ADDRESS, LOG_BYTES_IN_ADDRESS_SPACE, LOG_BYTES_IN_BYTE, LOG_BYTES_IN_CHAR, LOG_BYTES_IN_INT, LOG_BYTES_IN_KBYTE, LOG_BYTES_IN_MBYTE, LOG_BYTES_IN_PAGE, LOG_BYTES_IN_SHORT, LOG_BYTES_IN_WORD, LOG_CARD_BYTES, LOG_CARD_GRAIN, LOG_CARD_META_BYTES, LOG_CARD_META_PAGES, LOG_CARD_META_SIZE, LOG_CARD_UNITS, LOG_MIN_ALIGNMENT, MAX_ALIGNMENT, MAX_BYTES_PADDING, MAX_INT, MIN_ALIGNMENT, MIN_INT, SUPPORT_CARD_SCANNING
 
Constructor Summary
ChunkList()
           
 
Method Summary
(package private)  void addNewChunkToMap(Address chunk)
           
private  void checkMap()
           
 void consolidateMap()
           
 Address firstChunk(int ordinal, int stride)
           
private  int getChunkIndex(int entry)
           
private  int getChunkMap(int entry)
           
 Address getHeadChunk()
           
private  Address getMapAddress(int entry)
           
 Address getTailChunk()
           
 Address nextChunk(Address chunk)
          A chunk iterator.
private  Address nextChunk(Address chunk, Address limit)
          A chunk iterator.
 Address nextChunk(Address chunk, int start, int stride)
          A chunk iterator.
private  Address nextChunk(int entry, int start, int stride)
          A chunk iterator.
(package private)  void removeChunkFromMap(Address chunk)
           
(package private)  void reset()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_PAGES_IN_CHUNK_MAP_BLOCK

private static final int LOG_PAGES_IN_CHUNK_MAP_BLOCK
See Also:
Constant Field Values

ENTRIES_IN_CHUNK_MAP_BLOCK

private static final int ENTRIES_IN_CHUNK_MAP_BLOCK

CHUNK_MAP_BLOCKS

private static final int CHUNK_MAP_BLOCKS
See Also:
Constant Field Values

MAX_ENTRIES_IN_CHUNK_MAP

private static final int MAX_ENTRIES_IN_CHUNK_MAP

chunkMap

private AddressArray chunkMap

chunkMapLimit

private int chunkMapLimit

chunkMapCursor

private int chunkMapCursor
Constructor Detail

ChunkList

public ChunkList()
Method Detail

reset

void reset()

getHeadChunk

public Address getHeadChunk()

getTailChunk

public Address getTailChunk()

addNewChunkToMap

void addNewChunkToMap(Address chunk)

removeChunkFromMap

void removeChunkFromMap(Address chunk)

getChunkIndex

private int getChunkIndex(int entry)

getChunkMap

private int getChunkMap(int entry)

getMapAddress

private Address getMapAddress(int entry)

nextChunk

public Address nextChunk(Address chunk)
A chunk iterator. Return the next chunk in sequence, or null if the next chunk is the same chunk (ie there is only one chunk in the iterator).

Parameters:
chunk - The chunk
Returns:
The next chunk in the sequence, or null if next is chunk.

nextChunk

private Address nextChunk(Address chunk,
                          Address limit)
A chunk iterator. Return the next chunk in sequence, or null if the next chunk is limit.

Parameters:
chunk - The chunk
limit - The starting point (if next is equal to this, we're done)
Returns:
The next chunk in the sequence, or null if next is limit.

nextChunk

public Address nextChunk(Address chunk,
                         int start,
                         int stride)
A chunk iterator. Return the next chunk in sequence, strided by stride steps, or null if the next chunk is start.

Parameters:
chunk - The chunk
start - The point where this iterator started, which defines its end-point
stride - The stride by which the iterator should be stepped
Returns:
The next chunk in the sequence, or null if next is start.

nextChunk

private Address nextChunk(int entry,
                          int start,
                          int stride)
A chunk iterator. Return the next chunk in sequence, strided by stride steps, or null if the next chunk is start.

Parameters:
entry - The entry we're currently up to
start - The point where this iterator started, which defines its end-point
stride - The stride by which the iterator should be stepped
Returns:
The next chunk in the sequence, or null if next is start.

firstChunk

public Address firstChunk(int ordinal,
                          int stride)

checkMap

private void checkMap()

consolidateMap

public void consolidateMap()