org.jikesrvm.objectmodel
Class FieldLayoutPacked.LayoutContext

java.lang.Object
  extended by org.jikesrvm.objectmodel.FieldLayoutContext
      extended by org.jikesrvm.objectmodel.FieldLayoutPacked.LayoutContext
All Implemented Interfaces:
SizeConstants
Enclosing class:
FieldLayoutPacked

private static class FieldLayoutPacked.LayoutContext
extends FieldLayoutContext

Lay out an object, maintaining offsets of free slots of size 1,2,4 and 8 bytes.


Field Summary
private static int LOG_MAX_SLOT_SIZE
           
private static int MAX_SLOT_SIZE
           
private  short slot0
           
private  short slot1
           
private  short slot2
           
 
Fields inherited from class org.jikesrvm.objectmodel.FieldLayoutContext
OBJECT_SIZE_ALIGN
 
Fields inherited from interface org.jikesrvm.SizeConstants
BITS_IN_ADDRESS, BITS_IN_BOOLEAN, BITS_IN_BYTE, BITS_IN_CHAR, BITS_IN_DOUBLE, BITS_IN_EXTENT, BITS_IN_FLOAT, BITS_IN_INT, BITS_IN_LONG, BITS_IN_OFFSET, BITS_IN_PAGE, BITS_IN_SHORT, BITS_IN_WORD, BYTES_IN_ADDRESS, BYTES_IN_BOOLEAN, BYTES_IN_BYTE, BYTES_IN_CHAR, BYTES_IN_DOUBLE, BYTES_IN_EXTENT, BYTES_IN_FLOAT, BYTES_IN_INT, BYTES_IN_LONG, BYTES_IN_OFFSET, BYTES_IN_PAGE, BYTES_IN_SHORT, BYTES_IN_WORD, LOG_BITS_IN_ADDRESS, LOG_BITS_IN_BOOLEAN, LOG_BITS_IN_BYTE, LOG_BITS_IN_CHAR, LOG_BITS_IN_DOUBLE, LOG_BITS_IN_EXTENT, LOG_BITS_IN_FLOAT, LOG_BITS_IN_INT, LOG_BITS_IN_LONG, LOG_BITS_IN_OFFSET, LOG_BITS_IN_PAGE, LOG_BITS_IN_SHORT, LOG_BITS_IN_WORD, LOG_BYTES_IN_ADDRESS, LOG_BYTES_IN_BOOLEAN, LOG_BYTES_IN_BYTE, LOG_BYTES_IN_CHAR, LOG_BYTES_IN_DOUBLE, LOG_BYTES_IN_EXTENT, LOG_BYTES_IN_FLOAT, LOG_BYTES_IN_INT, LOG_BYTES_IN_LONG, LOG_BYTES_IN_OFFSET, LOG_BYTES_IN_PAGE, LOG_BYTES_IN_SHORT, LOG_BYTES_IN_WORD
 
Constructor Summary
FieldLayoutPacked.LayoutContext(byte alignment, FieldLayoutPacked.LayoutContext superLayout)
          Create a layout for an object, initializing offsets from its superclass.
 
Method Summary
private  short get(int logSize)
          Get the value for a given slot.
(package private)  int nextOffset(int size, boolean isReference)
          Return the next available offset for a given size
private  void set(int logSize, int value)
          Set the value for a given slot.
 
Methods inherited from class org.jikesrvm.objectmodel.FieldLayoutContext
adjustAlignment, ensureObjectSize, getAlignment, getObjectSize, setObjectSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG_MAX_SLOT_SIZE

private static final int LOG_MAX_SLOT_SIZE
See Also:
Constant Field Values

MAX_SLOT_SIZE

private static final int MAX_SLOT_SIZE
See Also:
Constant Field Values

slot0

private short slot0

slot1

private short slot1

slot2

private short slot2
Constructor Detail

FieldLayoutPacked.LayoutContext

FieldLayoutPacked.LayoutContext(byte alignment,
                                FieldLayoutPacked.LayoutContext superLayout)
Create a layout for an object, initializing offsets from its superclass.

Parameters:
alignment - Current alignment of first field.
superLayout - Superclass layout context
Method Detail

get

private short get(int logSize)
Get the value for a given slot.


set

private void set(int logSize,
                 int value)
Set the value for a given slot.


nextOffset

int nextOffset(int size,
               boolean isReference)
Return the next available offset for a given size

Specified by:
nextOffset in class FieldLayoutContext
Parameters:
size - Size of the field to be laid out. Must be a power of 2.