|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jikesrvm.mm.mminterface.AlignmentEncoding
public class AlignmentEncoding
Support for encoding a small amount of metadata in the alignment of a TIB. We choose the alignment of the TIB so that the pointer looks like
31 24 16 8 0 +-------+-------+-------+-------+ xxxxxxxxxxxxxxxxxxxxxxxxxxxxfff00where the natural alignment of the object is preserved (the low-order bits are zero), and the next least significant n bits contain the encoded metadata.
With the cooperation of MemoryManager, the idea is that we allocate 2^n additional words of memory, then offset the object within the allocated region so that the value of fff is encoded.
The current implementation specifically encodes the TIB pointer, because this is the only pointer field where this technique can give a speedup that makes it worthwhile.
Field Summary | |
---|---|
static int |
ALIGN_CODE_NONE
|
private static int |
ALIGNMENT_INCREMENT
How far do we need to shift the object to increment the encoded field by 1 |
private static int |
FIELD_SHIFT
First bit of the encoded field |
(package private) static int |
FIELD_WIDTH
Bits of metadata that we encode |
private static int |
MAX_ALIGN_WORDS
Maximum distance (in words) that we shift an object |
private static int |
TIB_ALIGN_MASK
Bit-mask to select out the encoded field |
private static boolean |
VERBOSE
|
Constructor Summary | |
---|---|
AlignmentEncoding()
|
Method Summary | |
---|---|
static Address |
adjustRegion(int alignCode,
Address region)
Adjust a region address so that the object pointer of an object that starts at this address will be aligned so as to encode the specified value. |
(package private) static void |
assertSanity(int alignCode)
Assert that a prospective encoded value is sane |
static int |
extractTibCode(Address address)
Extract the encoded value from a TIB pointer, represented as a raw address. |
static int |
getTibCode(ObjectReference object)
Extract the encoded value from an object's TIB pointer |
private static int |
getTibCodeForRegion(Address region)
|
static int |
padding(int alignCode)
Number of padding bytes required. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int ALIGN_CODE_NONE
static final int FIELD_WIDTH
private static final int MAX_ALIGN_WORDS
private static final int FIELD_SHIFT
private static final int ALIGNMENT_INCREMENT
private static final int TIB_ALIGN_MASK
private static final boolean VERBOSE
Constructor Detail |
---|
public AlignmentEncoding()
Method Detail |
---|
static void assertSanity(int alignCode)
alignCode
- Prospective encoded valuepublic static int padding(int alignCode)
alignCode
- Prospective encoded value.
public static Address adjustRegion(int alignCode, Address region)
alignCode
- Value to encoderegion
- The initial region
private static int getTibCodeForRegion(Address region)
public static int extractTibCode(Address address)
address
-
public static int getTibCode(ObjectReference object)
object
-
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |