org.mmtk.plan.semispace.usePrimitiveWriteBarriers
Class UsePrimitiveWriteBarriersMutator

java.lang.Object
  extended by org.mmtk.plan.MutatorContext
      extended by org.mmtk.plan.SimpleMutator
          extended by org.mmtk.plan.StopTheWorldMutator
              extended by org.mmtk.plan.semispace.SSMutator
                  extended by org.mmtk.plan.semispace.usePrimitiveWriteBarriers.UsePrimitiveWriteBarriersMutator
All Implemented Interfaces:
Constants

public class UsePrimitiveWriteBarriersMutator
extends SSMutator

This class extends the SSMutator class as part of the UsePrimitiveWriteBarriers collector. It overrides various methods in SSMutator to implement primitive write barriers.


Field Summary
 
Fields inherited from class org.mmtk.plan.semispace.SSMutator
ss
 
Fields inherited from class org.mmtk.plan.MutatorContext
immortal, lgcode, log, los, nonmove, smcode
 
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
UsePrimitiveWriteBarriersMutator()
           
 
Method Summary
 boolean addressTryCompareAndSwap(ObjectReference src, Address slot, Address old, Address value, Word metaDataA, Word metaDataB, int mode)
          Attempt to atomically exchange the value in the given slot with the passed replacement value.
 void addressWrite(ObjectReference src, Address slot, Address value, Word metaDataA, Word metaDataB, int mode)
          Write an Address.
 boolean booleanBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes)
          A number of booleans are about to be copied from object src to object dst (as in an array copy).
 void booleanWrite(ObjectReference src, Address slot, boolean value, Word metaDataA, Word metaDataB, int mode)
          Write a boolean.
 boolean byteBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes)
          A number of bytes are about to be copied from object src to object dst (as in an array copy).
 void byteWrite(ObjectReference src, Address slot, byte value, Word metaDataA, Word metaDataB, int mode)
          Write a byte.
 boolean charBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes)
          A number of chars are about to be copied from object src to object dst (as in an array copy).
 void charWrite(ObjectReference src, Address slot, char value, Word metaDataA, Word metaDataB, int mode)
          Write a char.
 boolean doubleBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes)
          A number of doubles are about to be copied from object src to object dst (as in an array copy).
 void doubleWrite(ObjectReference src, Address slot, double value, Word metaDataA, Word metaDataB, int mode)
          Write a double.
 void extentWrite(ObjectReference src, Address slot, Extent value, Word metaDataA, Word metaDataB, int mode)
          Write an Extent.
 boolean floatBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes)
          A number of floats are about to be copied from object src to object dst (as in an array copy).
 void floatWrite(ObjectReference src, Address slot, float value, Word metaDataA, Word metaDataB, int mode)
          Write a float.
 boolean intBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes)
          A number of ints are about to be copied from object src to object dst (as in an array copy).
 boolean intTryCompareAndSwap(ObjectReference src, Address slot, int old, int value, Word metaDataA, Word metaDataB, int mode)
          Attempt to atomically exchange the value in the given slot with the passed replacement value.
 void intWrite(ObjectReference src, Address slot, int value, Word metaDataA, Word metaDataB, int mode)
          Write a int.
 boolean longBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes)
          A number of longs are about to be copied from object src to object dst (as in an array copy).
 boolean longTryCompareAndSwap(ObjectReference src, Address slot, long old, long value, Word metaDataA, Word metaDataB, int mode)
          Attempt to atomically exchange the value in the given slot with the passed replacement value.
 void longWrite(ObjectReference src, Address slot, long value, Word metaDataA, Word metaDataB, int mode)
          Write a long.
 void offsetWrite(ObjectReference src, Address slot, Offset value, Word metaDataA, Word metaDataB, int mode)
          Write an Offset.
 boolean shortBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes)
          A number of shorts are about to be copied from object src to object dst (as in an array copy).
 void shortWrite(ObjectReference src, Address slot, short value, Word metaDataA, Word metaDataB, int mode)
          Write a short.
 boolean wordTryCompareAndSwap(ObjectReference src, Address slot, Word old, Word value, Word metaDataA, Word metaDataB, int mode)
          Attempt to atomically exchange the value in the given slot with the passed replacement value.
 void wordWrite(ObjectReference src, Address slot, Word value, Word metaDataA, Word metaDataB, int mode)
          Write a Word.
 
Methods inherited from class org.mmtk.plan.semispace.SSMutator
alloc, collectionPhase, getAllocatorFromSpace, initMutator, postAlloc, show
 
Methods inherited from class org.mmtk.plan.MutatorContext
addressBulkCopy, addressRead, assertRemsetsFlushed, booleanRead, byteRead, charRead, checkAllocator, deinitMutator, doubleRead, extentBulkCopy, extentRead, floatRead, flush, flushRememberedSets, getId, getLog, intRead, javaLangReferenceReadBarrier, longRead, objectReferenceBulkCopy, objectReferenceNonHeapRead, objectReferenceNonHeapWrite, objectReferenceRead, objectReferenceTryCompareAndSwap, objectReferenceWrite, offsetBulkCopy, offsetRead, shortRead, wordBulkCopy, wordRead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsePrimitiveWriteBarriersMutator

public UsePrimitiveWriteBarriersMutator()
Method Detail

addressWrite

public void addressWrite(ObjectReference src,
                         Address slot,
                         Address value,
                         Word metaDataA,
                         Word metaDataB,
                         int mode)
Write an Address. Take appropriate write barrier actions.

Overrides:
addressWrite in class MutatorContext
Parameters:
src - The object into which the Word will be stored
slot - The address into which the Word will be stored.
value - The value of the new Address
metaDataA - A value that assists the host VM in creating a store
metaDataB - A value that assists the host VM in creating a store
mode - The context in which the store occurred

addressTryCompareAndSwap

public boolean addressTryCompareAndSwap(ObjectReference src,
                                        Address slot,
                                        Address old,
                                        Address value,
                                        Word metaDataA,
                                        Word metaDataB,
                                        int mode)
Attempt to atomically exchange the value in the given slot with the passed replacement value.

Overrides:
addressTryCompareAndSwap in class MutatorContext
Parameters:
src - The object into which the Address will be stored
slot - The address into which the Address will be stored.
old - The old Address to be swapped out
value - The new Address
metaDataA - A value that assists the host VM in creating a store
metaDataB - A value that assists the host VM in creating a store
mode - The context in which the store occurred
Returns:
True if the swap was successful.

booleanWrite

public void booleanWrite(ObjectReference src,
                         Address slot,
                         boolean value,
                         Word metaDataA,
                         Word metaDataB,
                         int mode)
Write a boolean. Take appropriate write barrier actions.

Overrides:
booleanWrite in class MutatorContext
Parameters:
src - The object into which the new reference will be stored
slot - The address into which the new reference will be stored.
value - The value of the new boolean
metaDataA - A value that assists the host VM in creating a store
metaDataB - A value that assists the host VM in creating a store
mode - The context in which the store occurred

booleanBulkCopy

public boolean booleanBulkCopy(ObjectReference src,
                               Offset srcOffset,
                               ObjectReference dst,
                               Offset dstOffset,
                               int bytes)
Description copied from class: MutatorContext
A number of booleans are about to be copied from object src to object dst (as in an array copy). Thus, dst is the mutated object. Take appropriate write barrier actions.

Overrides:
booleanBulkCopy in class MutatorContext
Parameters:
src - The source array
srcOffset - The starting source offset
dst - The destination array
dstOffset - The starting destination offset
bytes - The number of bytes to be copied
Returns:
True if the update was performed by the barrier, false if left to the caller (always false in this case).

byteWrite

public void byteWrite(ObjectReference src,
                      Address slot,
                      byte value,
                      Word metaDataA,
                      Word metaDataB,
                      int mode)
Write a byte. Take appropriate write barrier actions.

Overrides:
byteWrite in class MutatorContext
Parameters:
src - The object into which the new reference will be stored
slot - The address into which the new reference will be stored.
value - The value of the new byte
metaDataA - A value that assists the host VM in creating a store
metaDataB - A value that assists the host VM in creating a store
mode - The context in which the store occurred

byteBulkCopy

public boolean byteBulkCopy(ObjectReference src,
                            Offset srcOffset,
                            ObjectReference dst,
                            Offset dstOffset,
                            int bytes)
Description copied from class: MutatorContext
A number of bytes are about to be copied from object src to object dst (as in an array copy). Thus, dst is the mutated object. Take appropriate write barrier actions.

Overrides:
byteBulkCopy in class MutatorContext
Parameters:
src - The source array
srcOffset - The starting source offset
dst - The destination array
dstOffset - The starting destination offset
bytes - The number of bytes to be copied
Returns:
True if the update was performed by the barrier, false if left to the caller (always false in this case).

charWrite

public void charWrite(ObjectReference src,
                      Address slot,
                      char value,
                      Word metaDataA,
                      Word metaDataB,
                      int mode)
Write a char. Take appropriate write barrier actions.

Overrides:
charWrite in class MutatorContext
Parameters:
src - The object into which the new reference will be stored
slot - The address into which the new reference will be stored.
value - The value of the new char
metaDataA - A value that assists the host VM in creating a store
metaDataB - A value that assists the host VM in creating a store
mode - The context in which the store occurred

charBulkCopy

public boolean charBulkCopy(ObjectReference src,
                            Offset srcOffset,
                            ObjectReference dst,
                            Offset dstOffset,
                            int bytes)
Description copied from class: MutatorContext
A number of chars are about to be copied from object src to object dst (as in an array copy). Thus, dst is the mutated object. Take appropriate write barrier actions.

Overrides:
charBulkCopy in class MutatorContext
Parameters:
src - The source array
srcOffset - The starting source offset
dst - The destination array
dstOffset - The starting destination offset
bytes - The number of bytes to be copied
Returns:
True if the update was performed by the barrier, false if left to the caller (always false in this case).

doubleWrite

public void doubleWrite(ObjectReference src,
                        Address slot,
                        double value,
                        Word metaDataA,
                        Word metaDataB,
                        int mode)
Write a double. Take appropriate write barrier actions.

Overrides:
doubleWrite in class MutatorContext
Parameters:
src - The object into which the new reference will be stored
slot - The address into which the new reference will be stored.
value - The value of the new double
metaDataA - A value that assists the host VM in creating a store
metaDataB - A value that assists the host VM in creating a store
mode - The context in which the store occurred

doubleBulkCopy

public boolean doubleBulkCopy(ObjectReference src,
                              Offset srcOffset,
                              ObjectReference dst,
                              Offset dstOffset,
                              int bytes)
Description copied from class: MutatorContext
A number of doubles are about to be copied from object src to object dst (as in an array copy). Thus, dst is the mutated object. Take appropriate write barrier actions.

Overrides:
doubleBulkCopy in class MutatorContext
Parameters:
src - The source array
srcOffset - The starting source offset
dst - The destination array
dstOffset - The starting destination offset
bytes - The number of bytes to be copied
Returns:
True if the update was performed by the barrier, false if left to the caller (always false in this case).

extentWrite

public void extentWrite(ObjectReference src,
                        Address slot,
                        Extent value,
                        Word metaDataA,
                        Word metaDataB,
                        int mode)
Write an Extent. Take appropriate write barrier actions.

Overrides:
extentWrite in class MutatorContext
Parameters:
src - The object into which the new reference will be stored
slot - The address into which the new reference will be stored.
value - The value of the new Extent
metaDataA - A value that assists the host VM in creating a store
metaDataB - A value that assists the host VM in creating a store
mode - The context in which the store occurred

floatWrite

public void floatWrite(ObjectReference src,
                       Address slot,
                       float value,
                       Word metaDataA,
                       Word metaDataB,
                       int mode)
Write a float. Take appropriate write barrier actions.

Overrides:
floatWrite in class MutatorContext
Parameters:
src - The object into which the new reference will be stored
slot - The address into which the new reference will be stored.
value - The value of the new float
metaDataA - A value that assists the host VM in creating a store
metaDataB - A value that assists the host VM in creating a store
mode - The context in which the store occurred

floatBulkCopy

public boolean floatBulkCopy(ObjectReference src,
                             Offset srcOffset,
                             ObjectReference dst,
                             Offset dstOffset,
                             int bytes)
Description copied from class: MutatorContext
A number of floats are about to be copied from object src to object dst (as in an array copy). Thus, dst is the mutated object. Take appropriate write barrier actions.

Overrides:
floatBulkCopy in class MutatorContext
Parameters:
src - The source array
srcOffset - The starting source offset
dst - The destination array
dstOffset - The starting destination offset
bytes - The number of bytes to be copied
Returns:
True if the update was performed by the barrier, false if left to the caller (always false in this case).

intWrite

public void intWrite(ObjectReference src,
                     Address slot,
                     int value,
                     Word metaDataA,
                     Word metaDataB,
                     int mode)
Write a int. Take appropriate write barrier actions.

Overrides:
intWrite in class MutatorContext
Parameters:
src - The object into which the new reference will be stored
slot - The address into which the new reference will be stored.
value - The value of the new int
metaDataA - A value that assists the host VM in creating a store
metaDataB - A value that assists the host VM in creating a store
mode - The context in which the store occurred

intBulkCopy

public boolean intBulkCopy(ObjectReference src,
                           Offset srcOffset,
                           ObjectReference dst,
                           Offset dstOffset,
                           int bytes)
Description copied from class: MutatorContext
A number of ints are about to be copied from object src to object dst (as in an array copy). Thus, dst is the mutated object. Take appropriate write barrier actions.

Overrides:
intBulkCopy in class MutatorContext
Parameters:
src - The source array
srcOffset - The starting source offset
dst - The destination array
dstOffset - The starting destination offset
bytes - The number of bytes to be copied
Returns:
True if the update was performed by the barrier, false if left to the caller (always false in this case).

intTryCompareAndSwap

public boolean intTryCompareAndSwap(ObjectReference src,
                                    Address slot,
                                    int old,
                                    int value,
                                    Word metaDataA,
                                    Word metaDataB,
                                    int mode)
Description copied from class: MutatorContext
Attempt to atomically exchange the value in the given slot with the passed replacement value. By default do nothing, override if appropriate.

Overrides:
intTryCompareAndSwap in class MutatorContext
Parameters:
src - The object into which the value will be stored
slot - The address into which the value will be stored.
old - The old int to be swapped out
value - The new int
metaDataA - A value that assists the host VM in creating a store
metaDataB - A value that assists the host VM in creating a store
mode - The context in which the store occurred
Returns:
True if the swap was successful.

longWrite

public void longWrite(ObjectReference src,
                      Address slot,
                      long value,
                      Word metaDataA,
                      Word metaDataB,
                      int mode)
Write a long. Take appropriate write barrier actions.

Overrides:
longWrite in class MutatorContext
Parameters:
src - The object into which the new reference will be stored
slot - The address into which the new reference will be stored.
value - The value of the new long
metaDataA - A value that assists the host VM in creating a store
metaDataB - A value that assists the host VM in creating a store
mode - The context in which the store occurred

longBulkCopy

public boolean longBulkCopy(ObjectReference src,
                            Offset srcOffset,
                            ObjectReference dst,
                            Offset dstOffset,
                            int bytes)
Description copied from class: MutatorContext
A number of longs are about to be copied from object src to object dst (as in an array copy). Thus, dst is the mutated object. Take appropriate write barrier actions.

Overrides:
longBulkCopy in class MutatorContext
Parameters:
src - The source array
srcOffset - The starting source offset
dst - The destination array
dstOffset - The starting destination offset
bytes - The number of bytes to be copied
Returns:
True if the update was performed by the barrier, false if left to the caller (always false in this case).

longTryCompareAndSwap

public boolean longTryCompareAndSwap(ObjectReference src,
                                     Address slot,
                                     long old,
                                     long value,
                                     Word metaDataA,
                                     Word metaDataB,
                                     int mode)
Description copied from class: MutatorContext
Attempt to atomically exchange the value in the given slot with the passed replacement value. By default do nothing, override if appropriate.

Overrides:
longTryCompareAndSwap in class MutatorContext
Parameters:
src - The object into which the value will be stored
slot - The address into which the value will be stored.
old - The old long to be swapped out
value - The new long
metaDataA - A value that assists the host VM in creating a store
metaDataB - A value that assists the host VM in creating a store
mode - The context in which the store occurred
Returns:
True if the swap was successful.

offsetWrite

public void offsetWrite(ObjectReference src,
                        Address slot,
                        Offset value,
                        Word metaDataA,
                        Word metaDataB,
                        int mode)
Write an Offset. Take appropriate write barrier actions.

Overrides:
offsetWrite in class MutatorContext
Parameters:
src - The object into which the new reference will be stored
slot - The address into which the new reference will be stored.
value - The value of the new Offset
metaDataA - A value that assists the host VM in creating a store
metaDataB - A value that assists the host VM in creating a store
mode - The context in which the store occurred

shortWrite

public void shortWrite(ObjectReference src,
                       Address slot,
                       short value,
                       Word metaDataA,
                       Word metaDataB,
                       int mode)
Write a short. Take appropriate write barrier actions.

Overrides:
shortWrite in class MutatorContext
Parameters:
src - The object into which the new reference will be stored
slot - The address into which the new reference will be stored.
value - The value of the new short
metaDataA - A value that assists the host VM in creating a store
metaDataB - A value that assists the host VM in creating a store
mode - The context in which the store occurred

shortBulkCopy

public boolean shortBulkCopy(ObjectReference src,
                             Offset srcOffset,
                             ObjectReference dst,
                             Offset dstOffset,
                             int bytes)
Description copied from class: MutatorContext
A number of shorts are about to be copied from object src to object dst (as in an array copy). Thus, dst is the mutated object. Take appropriate write barrier actions.

Overrides:
shortBulkCopy in class MutatorContext
Parameters:
src - The source array
srcOffset - The starting source offset
dst - The destination array
dstOffset - The starting destination offset
bytes - The number of bytes to be copied
Returns:
True if the update was performed by the barrier, false if left to the caller (always false in this case).

wordWrite

public void wordWrite(ObjectReference src,
                      Address slot,
                      Word value,
                      Word metaDataA,
                      Word metaDataB,
                      int mode)
Write a Word. Take appropriate write barrier actions.

Overrides:
wordWrite in class MutatorContext
Parameters:
src - The object into which the new reference will be stored
slot - The address into which the new reference will be stored.
value - The value of the new Word
metaDataA - A value that assists the host VM in creating a store
metaDataB - A value that assists the host VM in creating a store
mode - The context in which the store occurred

wordTryCompareAndSwap

public boolean wordTryCompareAndSwap(ObjectReference src,
                                     Address slot,
                                     Word old,
                                     Word value,
                                     Word metaDataA,
                                     Word metaDataB,
                                     int mode)
Description copied from class: MutatorContext
Attempt to atomically exchange the value in the given slot with the passed replacement value. By default do nothing, override if appropriate.

Overrides:
wordTryCompareAndSwap in class MutatorContext
Parameters:
src - The object into which the new reference will be stored
slot - The address into which the new reference will be stored.
old - The old Word to be swapped out
value - The new Word
metaDataA - A value that assists the host VM in creating a store
metaDataB - A value that assists the host VM in creating a store
mode - The context in which the store occurred
Returns:
True if the swap was successful.