org.mmtk.vm
Class VM

java.lang.Object
  extended by org.mmtk.vm.VM

public final class VM
extends Object

This class is responsible for all VM-specific functionality required by MMTk.

The class has three major elements. First it defines VM-specific constants which are used throughout MMTk, second, it declares singleton instances of each of the abstract classes in this package, and third, it provides factory methods for VM-specific instances which are needed by MMTk (such as Lock).

Both the constants and the singleton instances are initialized to VM-specific values at build time using reflection and a VM-specific factory class. The system property mmtk.hostjvm is interrogated at build time to establish concrete instantations of the abstract classes in this package. By convention, mmtk.hostjvm will identify a VM-provided package which includes concrete instances of each of the abstract classes, with each concrete class having the same base class name (but different package name) as the abstract classes defined here. The class initializer for this class then uses the system property mmtk.hostjvm to load the VM-specific concrete classes and initialize the constants and singletons defined here.


Field Summary
static ActivePlan activePlan
           
static int ALIGNMENT_VALUE
          The value to store in alignment holes
static Offset ARRAY_BASE_OFFSET
          The offset from an array reference to element zero
static Assert assertions
           
static Address AVAILABLE_END
          The highest address in the contiguously available memory available to MMTk
static Address AVAILABLE_START
          The lowest address in the contiguously available memory available to MMTk
static Barriers barriers
           
static Collection collection
           
static Config config
           
static boolean DEBUG
          Global debugging switch
static Debug debugging
           
static MMTk_Events events
           
private static Factory factory
           
static FinalizableProcessor finalizableProcessor
           
static Address HEAP_END
          The highest address in virtual memory known to MMTk
static Address HEAP_START
          The lowest address in virtual memory known to MMTk
static byte LOG_BYTES_IN_ADDRESS
          The log base two of the size of an address
static byte LOG_BYTES_IN_PAGE
          The log base two of the size of an OS page
static byte LOG_BYTES_IN_WORD
          The log base two of the size of a word
static byte LOG_MIN_ALIGNMENT
          The log base two of the minimum allocation alignment
static byte MAX_ALIGNMENT_SHIFT
          The log base two of (MAX_ALIGNMENT/MIN_ALIGNMENT)
static int MAX_BYTES_PADDING
          The maximum number of bytes of padding to prepend to an object
static Memory memory
           
static ObjectModel objectModel
           
static ReferenceProcessor phantomReferences
           
static Scanning scanning
           
static ReferenceProcessor softReferences
           
static Statistics statistics
           
static Strings strings
           
static TraceInterface traceInterface
           
static boolean VERIFY_ASSERTIONS
          true if assertions should be verified
private static String vmFactory
           
static ReferenceProcessor weakReferences
           
 
Constructor Summary
VM()
           
 
Method Summary
static ByteStream newGCspyByteStream(AbstractDriver driver, String name, byte minValue, byte maxValue, byte zeroValue, byte defaultValue, String stringPre, String stringPost, int presentation, int paintStyle, int indexMaxStream, Color colour, boolean summary)
          Create a new ByteStream instance using the appropriate VM-specific concrete ByteStream sub-class.
static IntStream newGCspyIntStream(AbstractDriver driver, String name, int minValue, int maxValue, int zeroValue, int defaultValue, String stringPre, String stringPost, int presentation, int paintStyle, int indexMaxStream, Color colour, boolean summary)
          Create a new IntStream instance using the appropriate VM-specific concrete IntStream sub-class.
static ServerInterpreter newGCspyServerInterpreter()
          Create a new ServerInterpreter instance using the appropriate VM-specific concrete ServerInterpreter sub-class.
static ServerSpace newGCspyServerSpace(ServerInterpreter serverInterpreter, String serverName, String driverName, String title, String blockInfo, int tileNum, String unused, boolean mainSpace)
          Create a new ServerInterpreter instance using the appropriate VM-specific concrete ServerInterpreter sub-class.
static ShortStream newGCspyShortStream(AbstractDriver driver, String name, short minValue, short maxValue, short zeroValue, short defaultValue, String stringPre, String stringPost, int presentation, int paintStyle, int indexMaxStream, Color colour, boolean summary)
          Create a new ShortStream instance using the appropriate VM-specific concrete ShortStream sub-class.
static Util newGCspyUtil()
          Create a new Util instance using the appropriate VM-specific concrete Util sub-class.
static Monitor newHeavyCondLock(String name)
          Create a new HeavyCondLock instance using the appropriate VM-specific concrete Lock sub-class.
static Lock newLock(String name)
          Create a new Lock instance using the appropriate VM-specific concrete Lock sub-class.
static SynchronizedCounter newSynchronizedCounter()
          Create a new SynchronizedCounter instance using the appropriate VM-specific concrete SynchronizedCounter sub-class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VERIFY_ASSERTIONS

public static final boolean VERIFY_ASSERTIONS
true if assertions should be verified


HEAP_START

public static final Address HEAP_START
The lowest address in virtual memory known to MMTk


HEAP_END

public static final Address HEAP_END
The highest address in virtual memory known to MMTk


AVAILABLE_START

public static final Address AVAILABLE_START
The lowest address in the contiguously available memory available to MMTk


AVAILABLE_END

public static final Address AVAILABLE_END
The highest address in the contiguously available memory available to MMTk


LOG_BYTES_IN_ADDRESS

public static final byte LOG_BYTES_IN_ADDRESS
The log base two of the size of an address


LOG_BYTES_IN_WORD

public static final byte LOG_BYTES_IN_WORD
The log base two of the size of a word


LOG_BYTES_IN_PAGE

public static final byte LOG_BYTES_IN_PAGE
The log base two of the size of an OS page


LOG_MIN_ALIGNMENT

public static final byte LOG_MIN_ALIGNMENT
The log base two of the minimum allocation alignment


MAX_ALIGNMENT_SHIFT

public static final byte MAX_ALIGNMENT_SHIFT
The log base two of (MAX_ALIGNMENT/MIN_ALIGNMENT)


MAX_BYTES_PADDING

public static final int MAX_BYTES_PADDING
The maximum number of bytes of padding to prepend to an object


ALIGNMENT_VALUE

public static final int ALIGNMENT_VALUE
The value to store in alignment holes


ARRAY_BASE_OFFSET

public static final Offset ARRAY_BASE_OFFSET
The offset from an array reference to element zero


DEBUG

public static final boolean DEBUG
Global debugging switch


activePlan

public static final ActivePlan activePlan

assertions

public static final Assert assertions

barriers

public static final Barriers barriers

collection

public static final Collection collection

config

public static final Config config

memory

public static final Memory memory

objectModel

public static final ObjectModel objectModel

weakReferences

public static final ReferenceProcessor weakReferences

softReferences

public static final ReferenceProcessor softReferences

phantomReferences

public static final ReferenceProcessor phantomReferences

finalizableProcessor

public static final FinalizableProcessor finalizableProcessor

scanning

public static final Scanning scanning

statistics

public static final Statistics statistics

strings

public static final Strings strings

traceInterface

public static final TraceInterface traceInterface

events

public static final MMTk_Events events

debugging

public static final Debug debugging

factory

private static final Factory factory

vmFactory

private static final String vmFactory
Constructor Detail

VM

public VM()
Method Detail

newLock

public static Lock newLock(String name)
Create a new Lock instance using the appropriate VM-specific concrete Lock sub-class.

Parameters:
name - The string to be associated with this lock instance
Returns:
A concrete VM-specific Lock instance.
See Also:
Lock

newHeavyCondLock

public static Monitor newHeavyCondLock(String name)
Create a new HeavyCondLock instance using the appropriate VM-specific concrete Lock sub-class.

Parameters:
name - The string to be associated with this instance
Returns:
A concrete VM-specific HeavyCondLock instance.
See Also:
Monitor

newSynchronizedCounter

public static SynchronizedCounter newSynchronizedCounter()
Create a new SynchronizedCounter instance using the appropriate VM-specific concrete SynchronizedCounter sub-class.

Returns:
A concrete VM-specific SynchronizedCounter instance.
See Also:
SynchronizedCounter

newGCspyUtil

public static Util newGCspyUtil()
Create a new Util instance using the appropriate VM-specific concrete Util sub-class.

Returns:
A concrete VM-specific Util instance.
See Also:
Util

newGCspyServerInterpreter

public static ServerInterpreter newGCspyServerInterpreter()
Create a new ServerInterpreter instance using the appropriate VM-specific concrete ServerInterpreter sub-class.

Returns:
A concrete VM-specific ServerInterpreter instance.
See Also:
ServerInterpreter

newGCspyServerSpace

public static ServerSpace newGCspyServerSpace(ServerInterpreter serverInterpreter,
                                              String serverName,
                                              String driverName,
                                              String title,
                                              String blockInfo,
                                              int tileNum,
                                              String unused,
                                              boolean mainSpace)
Create a new ServerInterpreter instance using the appropriate VM-specific concrete ServerInterpreter sub-class.

Returns:
A concrete VM-specific ServerInterpreter instance.
See Also:
ServerInterpreter

newGCspyByteStream

public static ByteStream newGCspyByteStream(AbstractDriver driver,
                                            String name,
                                            byte minValue,
                                            byte maxValue,
                                            byte zeroValue,
                                            byte defaultValue,
                                            String stringPre,
                                            String stringPost,
                                            int presentation,
                                            int paintStyle,
                                            int indexMaxStream,
                                            Color colour,
                                            boolean summary)
Create a new ByteStream instance using the appropriate VM-specific concrete ByteStream sub-class.

Parameters:
driver - The driver that owns this Stream
name - The name of the stream (e.g. "Used space")
minValue - The minimum value for any item in this stream. Values less than this will be represented as "minValue-"
maxValue - The maximum value for any item in this stream. Values greater than this will be represented as "maxValue+"
zeroValue - The zero value for this stream
defaultValue - The default value for this stream
stringPre - A string to prefix values (e.g. "Used: ")
stringPost - A string to suffix values (e.g. " bytes.")
presentation - How a stream value is to be presented.
paintStyle - How the value is to be painted.
indexMaxStream - The index of the maximum stream if the presentation is *_VAR.
colour - The default colour for tiles of this stream
Returns:
A concrete VM-specific ByteStream instance.
See Also:
IntStream

newGCspyIntStream

public static IntStream newGCspyIntStream(AbstractDriver driver,
                                          String name,
                                          int minValue,
                                          int maxValue,
                                          int zeroValue,
                                          int defaultValue,
                                          String stringPre,
                                          String stringPost,
                                          int presentation,
                                          int paintStyle,
                                          int indexMaxStream,
                                          Color colour,
                                          boolean summary)
Create a new IntStream instance using the appropriate VM-specific concrete IntStream sub-class.

Parameters:
driver - The driver that owns this Stream
name - The name of the stream (e.g. "Used space")
minValue - The minimum value for any item in this stream. Values less than this will be represented as "minValue-"
maxValue - The maximum value for any item in this stream. Values greater than this will be represented as "maxValue+"
zeroValue - The zero value for this stream
defaultValue - The default value for this stream
stringPre - A string to prefix values (e.g. "Used: ")
stringPost - A string to suffix values (e.g. " bytes.")
presentation - How a stream value is to be presented.
paintStyle - How the value is to be painted.
indexMaxStream - The index of the maximum stream if the presentation is *_VAR.
colour - The default colour for tiles of this stream
Returns:
A concrete VM-specific IntStream instance.
See Also:
IntStream

newGCspyShortStream

public static ShortStream newGCspyShortStream(AbstractDriver driver,
                                              String name,
                                              short minValue,
                                              short maxValue,
                                              short zeroValue,
                                              short defaultValue,
                                              String stringPre,
                                              String stringPost,
                                              int presentation,
                                              int paintStyle,
                                              int indexMaxStream,
                                              Color colour,
                                              boolean summary)
Create a new ShortStream instance using the appropriate VM-specific concrete ShortStream sub-class.

Parameters:
driver - The driver that owns this Stream
name - The name of the stream (e.g. "Used space")
minValue - The minimum value for any item in this stream. Values less than this will be represented as "minValue-"
maxValue - The maximum value for any item in this stream. Values greater than this will be represented as "maxValue+"
zeroValue - The zero value for this stream
defaultValue - The default value for this stream
stringPre - A string to prefix values (e.g. "Used: ")
stringPost - A string to suffix values (e.g. " bytes.")
presentation - How a stream value is to be presented.
paintStyle - How the value is to be painted.
indexMaxStream - The index of the maximum stream if the presentation is *_VAR.
colour - The default colour for tiles of this stream
Returns:
A concrete VM-specific IntStream instance.
See Also:
IntStream