org.jikesrvm
Class VM

java.lang.Object
  extended by org.jikesrvm.Configuration
      extended by org.jikesrvm.Options
          extended by org.jikesrvm.Properties
              extended by org.jikesrvm.VM
All Implemented Interfaces:
Constants, HeapLayoutConstants, ThinLockConstants, TIBLayoutConstants, ExitStatus, SizeConstants

public class VM
extends Properties
implements Constants, ExitStatus

A virtual machine.


Field Summary
private static boolean inDieAbruptlyRecursiveSystemTrouble
          Have we already called dieAbruptlyRecursiveSystemTrouble()?
private static int inShutdown
           
private static int inSysExit
           
private static int inSysFail
           
static MainThread mainThread
          Reference to the main thread that is the first none VM thread run
private static int sysWriteLock
           
private static Offset sysWriteLockOffset
           
 
Fields inherited from class org.jikesrvm.Properties
fullyBooted, maxSystemTroubleRecursionDepthBeforeWeStopVMSysWrite, ReferenceMapsBitStatistics, ReferenceMapsStatistics, runningTool, runningVM, safeToAllocateJavaThread, TraceDictionaries, TraceExceptionDelivery, TraceFileSystem, TraceOnStackReplacement, TraceStackTrace, TraceStatics, TraceStkMaps, TraceThreads, verboseBoot, verboseClassLoading, verboseJNI, writingBootImage, writingImage
 
Fields inherited from class org.jikesrvm.Options
CBSCallSamplesPerTick, CBSCallSampleStride, CBSMethodSamplesPerTick, CBSMethodSampleStride, countThreadTransitions, EdgeCounterFile, ErrorsFatal, forceOneCPU, interruptQuantum, maxSystemTroubleRecursionDepth, MeasureCompilation, MeasureCompilationPhases, schedulingMultiplier, stackTraceAtExit, stackTraceFull, TraceClassLoading, traceJNI, TraceThreadScheduling, TuningForkTraceFile, VerboseStackTracePeriod
 
Fields inherited from class org.jikesrvm.Configuration
AlignmentChecking, archHelper, BuildFor32Addr, BuildFor64Addr, BuildForAdaptiveSystem, BuildForAix, BuildForGnuClasspath, BuildForHarmony, BuildForHwFsqrt, BuildForIA32, BuildForIMTInterfaceInvocation, BuildForITableInterfaceInvocation, BuildForLinux, BuildForMachOABI, BuildForOptCompiler, BuildForOsx, BuildForPowerOpenABI, BuildForPowerPC, BuildForSolaris, BuildForSSE2, BuildForSSE2Full, BuildForSVR4ABI, BuildWithBaseBootImageCompiler, BuildWithGCSpy, BuildWithGCTrace, ExplicitlyGuardLowMemory, ExtremeAssertions, ForceFrequentGC, LittleEndian, ParanoidVerifyUnint, PortableNativeSync, RVM_CONFIGURATION, RVM_VERSION_STRING, StressGCAllocationInterval, UseEpilogueYieldPoints, VerifyAssertions, VerifyUnint
 
Fields inherited from interface org.jikesrvm.Constants
NOT_REACHED, REFLECTION_FPRS_BITS, REFLECTION_FPRS_MASK, REFLECTION_GPRS_BITS, REFLECTION_GPRS_MASK
 
Fields inherited from interface org.jikesrvm.objectmodel.ThinLockConstants
TL_DEDICATED_U16_OFFSET, TL_DEDICATED_U16_SHIFT, TL_LOCK_COUNT_MASK, TL_LOCK_COUNT_SHIFT, TL_LOCK_COUNT_UNIT, TL_LOCK_ID_MASK, TL_LOCK_ID_SHIFT, TL_NUM_BITS_RC, TL_NUM_BITS_STAT, TL_NUM_BITS_TID, TL_STAT_BIASABLE, TL_STAT_FAT, TL_STAT_MASK, TL_STAT_SHIFT, TL_STAT_THIN, TL_THREAD_ID_MASK, TL_THREAD_ID_SHIFT, TL_UNLOCK_MASK
 
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
 
Fields inherited from interface org.jikesrvm.objectmodel.TIBLayoutConstants
IMT_METHOD_SLOTS, NEEDS_DYNAMIC_LINK, TIB_ARRAY_ELEMENT_TIB_INDEX, TIB_DOES_IMPLEMENT_INDEX, TIB_FIRST_SPECIALIZED_METHOD_INDEX, TIB_FIRST_VIRTUAL_METHOD_INDEX, TIB_INTERFACE_DISPATCH_TABLE_INDEX, TIB_SUPERCLASS_IDS_INDEX, TIB_TYPE_INDEX
 
Fields inherited from interface org.jikesrvm.HeapLayoutConstants
BAD_MAP_COMPRESSION, BOOT_IMAGE_CODE_END, BOOT_IMAGE_CODE_SIZE, BOOT_IMAGE_CODE_START, BOOT_IMAGE_DATA_END, BOOT_IMAGE_DATA_SIZE, BOOT_IMAGE_DATA_START, BOOT_IMAGE_END, BOOT_IMAGE_RMAP_END, BOOT_IMAGE_RMAP_START, MAX_BOOT_IMAGE_RMAP_SIZE, MAXIMUM_MAPPABLE
 
Fields inherited from interface org.jikesrvm.runtime.ExitStatus
EXIT_STATUS_BAD_WORKING_DIR, EXIT_STATUS_BOGUS_COMMAND_LINE_ARG, EXIT_STATUS_COULD_NOT_EXECUTE, EXIT_STATUS_DUMP_STACK_AND_DIE, EXIT_STATUS_DYING_WITH_UNCAUGHT_EXCEPTION, EXIT_STATUS_EXECUTABLE_NOT_FOUND, EXIT_STATUS_IMPOSSIBLE_LIBRARY_FUNCTION_ERROR, EXIT_STATUS_JNI_COMPILER_FAILED, EXIT_STATUS_JNI_TROUBLE, EXIT_STATUS_MAIN_THREAD_COULD_NOT_LAUNCH, EXIT_STATUS_MISC_TROUBLE, EXIT_STATUS_OPT_COMPILER_FAILED, EXIT_STATUS_PRINTED_HELP_MESSAGE, EXIT_STATUS_RECURSIVELY_SHUTTING_DOWN, EXIT_STATUS_SYSCALL_TROUBLE, EXIT_STATUS_SYSFAIL, EXIT_STATUS_TIMER_TROUBLE, EXIT_STATUS_TOO_MANY_OUT_OF_MEMORY_ERRORS, EXIT_STATUS_TOO_MANY_THROWABLE_ERRORS, EXIT_STATUS_UNEXPECTED_CALL_TO_SYS, EXIT_STATUS_UNSUPPORTED_INTERNAL_OP
 
Constructor Summary
VM()
           
 
Method Summary
static void _assert(boolean b)
          Verify a runtime assertion (die w/traceback if assertion fails).
static void _assert(boolean b, String message)
          Verify a runtime assertion (die w/message and traceback if assertion fails).
static void _assert(boolean b, String msg1, String msg2)
           
private static void _assertionFailure(String msg1, String msg2)
           
static String addressAsHexString(Address addr)
          Format a 32/64 bit number as "0x" followed by 8/16 hex digits.
static void boot()
          Begin VM execution.
static void bugReportMessage()
          Produce a message requesting a bug report be submitted
static boolean buildFor32Addr()
          Is this a build for 32bit addressing?
static boolean buildForSSE2()
          Is this a build for SSE2?
static void dieAbruptlyRecursiveSystemTrouble()
           
static void disableGC()
          The disableGC() and enableGC() methods are for use as guards to protect code that must deal with raw object addresses in a collection-safe manner (i.e. code that holds raw pointers across "gc-sites").
static void disableGC(boolean recursiveOK)
          disableGC: Disable GC if it hasn't already been disabled.
static void disableYieldpoints()
           
static void enableGC()
          enable GC; entry point when recursion is not OK.
static void enableGC(boolean recursiveOK)
          enableGC(): Re-Enable GC if we're popping off the last possibly-recursive disableGC() request.
static void enableYieldpoints()
           
private static void finishBooting()
          Complete the task of booting Jikes RVM.
private static int getStringLength(String s)
           
private static void handlePossibleRecursiveCallToSysExit()
           
private static void handlePossibleRecursiveCallToSysFail(String message)
           
private static void handlePossibleRecursiveCallToSysFail(String message, int number)
           
private static void handlePossibleRecursiveExit(String called, int depth)
           
private static void handlePossibleRecursiveExit(String called, int depth, String message)
           
private static void handlePossibleRecursiveExit(String called, int depth, String message, boolean showNumber, int number)
           
private static void handlePossibleRecursiveExit(String called, int depth, String message, int number)
           
private static void handlePossibleRecursiveShutdown()
          Used only by VM.shutdown()
private static void init(String bootstrapClasspath, String[] bootCompilerArgs)
          Create class instances needed for boot image or initialize classes needed by tools.
static void initForBootImageWriter(String classPath, String[] bootCompilerArgs)
          Prepare VM classes for use by boot image writer.
static void initForTool()
          Prepare VM classes for use by tools.
static void initForTool(String classpath)
          Prepare VM classes for use by tools.
static String intAsHexString(int number)
          Format a 32 bit number as "0x" followed by 8 hex digits.
static String longAsHexString(long number)
          Format a 64 bit number as "0x" followed by 16 hex digits.
private static void pleaseSpecifyAClass()
           
(package private) static void runClassInitializer(String className)
          Run <clinit> method of specified class, if that class appears in bootimage and actually has a clinit method (we are flexible to allow one list of classes to work with different bootimages and different version of classpath (eg 0.05 vs. cvs head).
private static void showThread()
           
static void shutdown(int value)
          Shut down the virtual machine.
private static void swLock()
           
private static void swUnlock()
           
static void sysExit(int value)
          Exit virtual machine.
static void sysFail(String message)
          Exit virtual machine due to internal failure of some sort.
static void sysFail(String message, int number)
          Exit virtual machine due to internal failure of some sort.
static boolean sysFailInProgress()
           
static void sysWrite(Address a)
           
static void sysWrite(Atom a)
          A group of multi-argument sysWrites with optional newline.
static void sysWrite(boolean b)
           
static void sysWrite(char c)
           
static void sysWrite(char[] c, int l)
           
static void sysWrite(double d)
           
static void sysWrite(double d, int p)
           
static void sysWrite(double d, String s)
           
static void sysWrite(Extent e)
           
static void sysWrite(int i)
           
static void sysWrite(int i, String s)
           
static void sysWrite(int i, String s1, double d, String s2)
           
static void sysWrite(int i1, String s, int i2)
           
static void sysWrite(int i1, String s1, String s2)
           
static void sysWrite(MemberReference mr)
           
static void sysWrite(ObjectReference o)
           
static void sysWrite(Offset o)
           
static void sysWrite(RVMMember m)
           
static void sysWrite(String s)
           
static void sysWrite(String s, Address a)
           
static void sysWrite(String s1, Address a, String s2)
           
static void sysWrite(String s1, Address a1, String s2, Address a2)
           
static void sysWrite(String s1, Address a, String s2, int i)
           
static void sysWrite(String s, boolean b)
           
static void sysWrite(String s, double d)
           
static void sysWrite(String s1, double d, String s2)
           
static void sysWrite(String s, int i)
           
static void sysWrite(String s1, int i, String s2)
           
static void sysWrite(String s1, int i1, String s2, int i2)
           
static void sysWrite(String s1, int i1, String s2, long l1)
           
static void sysWrite(String s, long i)
           
static void sysWrite(String s, ObjectReference r)
           
static void sysWrite(String s, Offset o)
           
static void sysWrite(String s1, Offset o, String s2)
           
static void sysWrite(String s1, Offset o, String s2, int i)
           
static void sysWrite(String s1, String s2)
           
static void sysWrite(String s1, String s2, Address a)
           
static void sysWrite(String s1, String s2, int i)
           
static void sysWrite(String s1, String s2, int i1, String s3)
           
static void sysWrite(String s1, String s2, String s3)
           
static void sysWrite(String s1, String s2, String s3, int i1)
           
static void sysWrite(String s1, String s2, String s3, int i1, String s4)
           
static void sysWrite(String s1, String s2, String s3, String s4)
           
static void sysWrite(String s1, String s2, String s3, String s4, int i5, String s6)
           
static void sysWrite(String s1, String s2, String s3, String s4, String s5)
           
static void sysWrite(String s, Word w)
           
static void sysWrite(Word w)
           
static void sysWriteField(int w, int v)
           
static void sysWriteField(int w, String s)
           
static void sysWriteHex(Address v)
           
static void sysWriteHex(int v)
           
static void sysWriteHex(long v)
           
static void sysWriteInt(int v)
           
static void sysWriteln()
           
static void sysWriteln(Address a)
           
static void sysWriteln(Atom a)
           
static void sysWriteln(boolean b)
           
static void sysWriteln(double d)
           
static void sysWriteln(double d, String s)
           
static void sysWriteln(Extent e)
           
static void sysWriteln(int i)
           
static void sysWriteln(int i, Address a, Address b)
           
static void sysWriteln(int i, Address a, RVMMethod m)
           
static void sysWriteln(int i, String s)
           
static void sysWriteln(int i, String s, Address a)
           
static void sysWriteln(int i, String s1, double d, String s2)
           
static void sysWriteln(int i1, String s, int i2)
           
static void sysWriteln(int i1, String s1, String s2)
           
static void sysWriteln(long l)
           
static void sysWriteln(ObjectReference o)
           
static void sysWriteln(Offset o)
           
static void sysWriteln(String s)
           
static void sysWriteln(String s, Address a)
           
static void sysWriteln(String s1, Address a1, Address a2)
           
static void sysWriteln(String s1, Address a, String s2)
           
static void sysWriteln(String s1, Address a1, String s2, Address a2)
           
static void sysWriteln(String s1, Address a, String s2, int i)
           
static void sysWriteln(String s0, Address a1, String s1, Word w1, String s2, int i1, String s3, int i2, String s4, Word w2, String s5, int i3)
           
static void sysWriteln(String s, Atom a)
           
static void sysWriteln(String s, boolean b)
           
static void sysWriteln(String s, double d)
           
static void sysWriteln(String s1, double d, String s2)
           
static void sysWriteln(String s, int i)
           
static void sysWriteln(String s1, int i, String s2)
           
static void sysWriteln(String s1, int i, String s2, Address a)
           
static void sysWriteln(String s1, int i, String s3, Address a, String s5)
           
static void sysWriteln(String s1, int i, String s2, double d)
           
static void sysWriteln(String s1, int i1, String s2, int i2)
           
static void sysWriteln(String s1, int i1, String s2, int i2, String s3)
           
static void sysWriteln(String s1, int i1, String s2, int i2, String s3, int i3)
           
static void sysWriteln(String s1, int i1, String s2, long l1)
           
static void sysWriteln(String s1, int i, String s2, Word w)
           
static void sysWriteln(String s1, int i, String s2, Word w, String s3)
           
static void sysWriteln(String s, long i)
           
static void sysWriteln(String s1, long i1, String s2, long i2)
           
static void sysWriteln(String s1, long l1, String s2, long l2, String s3)
           
static void sysWriteln(String s, ObjectReference r)
           
static void sysWriteln(String s, Offset o)
           
static void sysWriteln(String s1, Offset o, String s2)
           
static void sysWriteln(String s1, Offset o, String s2, int i)
           
static void sysWriteln(String s1, String s2)
           
static void sysWriteln(String s1, String s2, Address a)
           
static void sysWriteln(String s1, String s2, int i)
           
static void sysWriteln(String s1, String s2, int i1, String s3)
           
static void sysWriteln(String s1, String s2, String s3)
           
static void sysWriteln(String s1, String s2, String s3, Address a)
           
static void sysWriteln(String s1, String s2, String s3, int i1)
           
static void sysWriteln(String s1, String s2, String s3, int i1, String s4)
           
static void sysWriteln(String s1, String s2, String s3, String s4)
           
static void sysWriteln(String s1, String s2, String s3, String s4, int i5, String s6)
           
static void sysWriteln(String s1, String s2, String s3, String s4, String s5)
           
static void sysWriteln(String s, Word w)
           
static void sysWriteln(Word w)
           
static void sysWriteLong(long v)
           
static void tsysWrite(char[] c, int l)
           
static void tsysWriteln(Address a)
           
static void tsysWriteln(String s)
           
static void tsysWriteln(String s, Address a)
           
static void tsysWriteln(String s1, Address a1, String s2, Address a2)
           
static void tsysWriteln(String s1, Address a1, String s2, Address a2, String s3, Address a3)
           
static void tsysWriteln(String s1, Address a1, String s2, Address a2, String s3, Address a3, String s4, Address a4)
           
static void tsysWriteln(String s1, Address a1, String s2, Address a2, String s3, Address a3, String s4, Address a4, String s5, Address a5)
           
static void tsysWriteln(String s, int i)
           
static void tsysWriteln(String s1, String s2, String s3, int i4, String s5, String s6)
           
static void tsysWriteln(String s1, String s2, String s3, String s4, String s5, String s6, String s7, int i8, String s9, String s10, String s11, String s12, String s13)
           
static void tsysWriteln(String s1, String s2, String s3, String s4, String s5, String s6, String s7, int i8, String s9, String s10, String s11, String s12, String s13, int i14)
           
static void write(Address addr)
           
private static void write(Atom value)
          Low level print to console.
static void write(boolean b)
           
static void write(char value)
          Low level print of a charto console.
static void write(char[] value, int len)
          Low level print to console.
static void write(double d)
           
static void write(double value, int postDecimalDigits)
          Low level print of double to console.
static void write(Extent addr)
           
static void write(int value)
          Low level print of an int to console.
static void write(long value)
          Low level print to console.
static void write(long value, boolean hexToo)
          Low level print to console.
static void write(MemberReference value)
          Low level print to console.
static void write(ObjectReference object)
           
static void write(Offset addr)
           
static void write(RVMMember value)
          Low level print to console.
static void write(String value)
          Low level print to console.
static void write(Word addr)
           
static void writeDec(Word value)
           
static void writeField(int fieldWidth, Atom s)
          Low level print of the Atom s to the console.
static void writeField(int fieldWidth, int value)
          Low level print to console.
static void writeField(int fieldWidth, String s)
           
static void writeHex(Address value)
           
static void writeHex(Extent value)
           
static void writeHex(int value)
          Low level print to console.
static void writeHex(long value)
          Low level print to console.
static void writeHex(ObjectReference value)
           
static void writeHex(Offset value)
           
static void writeHex(Word value)
           
private static void writeHexNotRunningVM(int value)
           
private static void writeHexNotRunningVM(long value)
           
static void writeInt(int value)
          Low level print to console.
static void writeln()
           
private static void writeNotRunningVM(char value)
           
private static void writeNotRunningVM(double value)
           
private static void writeNotRunningVM(int value)
           
private static void writeNotRunningVM(long value)
           
private static void writeNotRunningVM(String value)
           
 
Methods inherited from class org.jikesrvm.Options
printHelp, printOptions, process
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mainThread

public static MainThread mainThread
Reference to the main thread that is the first none VM thread run


sysWriteLock

private static int sysWriteLock

sysWriteLockOffset

private static Offset sysWriteLockOffset

inSysFail

private static int inSysFail

inSysExit

private static int inSysExit

inShutdown

private static int inShutdown

inDieAbruptlyRecursiveSystemTrouble

private static boolean inDieAbruptlyRecursiveSystemTrouble
Have we already called dieAbruptlyRecursiveSystemTrouble()? Only for use if we're recursively shutting down! Used by dieAbruptlyRecursiveSystemTrouble() only.

Constructor Detail

VM

public VM()
Method Detail

initForBootImageWriter

public static void initForBootImageWriter(String classPath,
                                          String[] bootCompilerArgs)
Prepare VM classes for use by boot image writer.

Parameters:
classPath - class path to be used by RVMClassLoader
bootCompilerArgs - command line arguments for the bootimage compiler

initForTool

public static void initForTool()
Prepare VM classes for use by tools.


initForTool

public static void initForTool(String classpath)
Prepare VM classes for use by tools.

Parameters:
classpath - class path to be used by RVMClassLoader

boot

public static void boot()
Begin VM execution.

Uninterruptible because we are not setup to execute a yieldpoint or stackoverflow check in the prologue this early in booting.

The following machine registers are set by "C" bootstrap program before calling this method:

  1. JTOC_POINTER - required for accessing globals
  2. FRAME_POINTER - required for accessing locals
  3. THREAD_ID_REGISTER - required for method prolog (stack overflow check)


finishBooting

private static void finishBooting()
Complete the task of booting Jikes RVM. Done in a secondary method mainly because this code doesn't have to be uninterruptible and this is the cleanest way to make that distinction.


pleaseSpecifyAClass

private static void pleaseSpecifyAClass()

runClassInitializer

static void runClassInitializer(String className)
Run <clinit> method of specified class, if that class appears in bootimage and actually has a clinit method (we are flexible to allow one list of classes to work with different bootimages and different version of classpath (eg 0.05 vs. cvs head).

This method is called only while the VM boots.

Parameters:
className -

_assert

public static void _assert(boolean b)
Verify a runtime assertion (die w/traceback if assertion fails).

Note: code your assertion checks as if (VM.VerifyAssertions) VM._assert(xxx);

Parameters:
b - the assertion to verify

_assert

public static void _assert(boolean b,
                           String message)
Verify a runtime assertion (die w/message and traceback if assertion fails).

Note: code your assertion checks as if (VM.VerifyAssertions) VM._assert(xxx);

Parameters:
b - the assertion to verify
message - the message to print if the assertion is false

_assert

public static void _assert(boolean b,
                           String msg1,
                           String msg2)

_assertionFailure

private static void _assertionFailure(String msg1,
                                      String msg2)

intAsHexString

public static String intAsHexString(int number)
Format a 32 bit number as "0x" followed by 8 hex digits. Do this without referencing Integer or Character classes, in order to avoid dynamic linking. TODO: move this method to Services.

Parameters:
number -
Returns:
a String with the hex representation of the integer

longAsHexString

public static String longAsHexString(long number)
Format a 64 bit number as "0x" followed by 16 hex digits. Do this without referencing Long or Character classes, in order to avoid dynamic linking. TODO: move this method to Services.

Parameters:
number -
Returns:
a String with the hex representation of the long

addressAsHexString

public static String addressAsHexString(Address addr)
Format a 32/64 bit number as "0x" followed by 8/16 hex digits. Do this without referencing Integer or Character classes, in order to avoid dynamic linking. TODO: move this method to Services.

Parameters:
addr - The 32/64 bit number to format.
Returns:
a String with the hex representation of an Address

swLock

private static void swLock()

swUnlock

private static void swUnlock()

write

private static void write(Atom value)
Low level print to console.

Parameters:
value - what is printed

write

public static void write(RVMMember value)
Low level print to console.

Parameters:
value - what is printed

write

public static void write(MemberReference value)
Low level print to console.

Parameters:
value - what is printed

write

public static void write(String value)
Low level print to console.

Parameters:
value - what is printed

writeNotRunningVM

private static void writeNotRunningVM(String value)

write

public static void write(char[] value,
                         int len)
Low level print to console.

Parameters:
value - character array that is printed
len - number of characters printed

write

public static void write(char value)
Low level print of a charto console.

Parameters:
value - The character to print

writeNotRunningVM

private static void writeNotRunningVM(char value)

write

public static void write(double value,
                         int postDecimalDigits)
Low level print of double to console.

Parameters:
value - double to be printed
postDecimalDigits - Number of decimal places

writeNotRunningVM

private static void writeNotRunningVM(double value)

write

public static void write(int value)
Low level print of an int to console.

Parameters:
value - what is printed

writeNotRunningVM

private static void writeNotRunningVM(int value)

writeHex

public static void writeHex(int value)
Low level print to console.

Parameters:
value - What is printed, as hex only

writeHexNotRunningVM

private static void writeHexNotRunningVM(int value)

writeHex

public static void writeHex(long value)
Low level print to console.

Parameters:
value - what is printed, as hex only

writeHexNotRunningVM

private static void writeHexNotRunningVM(long value)

writeDec

public static void writeDec(Word value)

writeHex

public static void writeHex(Word value)

writeHex

public static void writeHex(Address value)

writeHex

public static void writeHex(ObjectReference value)

writeHex

public static void writeHex(Extent value)

writeHex

public static void writeHex(Offset value)

writeInt

public static void writeInt(int value)
Low level print to console.

Parameters:
value - what is printed, as int only

writeNotRunningVM

private static void writeNotRunningVM(long value)

write

public static void write(long value)
Low level print to console.

Parameters:
value - what is printed

write

public static void write(long value,
                         boolean hexToo)
Low level print to console.

Parameters:
value - what is printed
hexToo - how to print: true - print as decimal followed by hex false - print as decimal only

writeField

public static void writeField(int fieldWidth,
                              String s)

getStringLength

private static int getStringLength(String s)

writeField

public static void writeField(int fieldWidth,
                              int value)
Low level print to console.

Parameters:
value - print value and left-fill with enough spaces to print at least fieldWidth characters

writeField

public static void writeField(int fieldWidth,
                              Atom s)
Low level print of the Atom s to the console. Left-fill with enough spaces to print at least fieldWidth characters

Parameters:
fieldWidth - Minimum width to print.
s - The Atom to print.

writeln

public static void writeln()

write

public static void write(double d)

write

public static void write(Word addr)

write

public static void write(Address addr)

write

public static void write(ObjectReference object)

write

public static void write(Offset addr)

write

public static void write(Extent addr)

write

public static void write(boolean b)

sysWrite

public static void sysWrite(Atom a)
A group of multi-argument sysWrites with optional newline. Externally visible methods.


sysWriteln

public static void sysWriteln(Atom a)

sysWrite

public static void sysWrite(RVMMember m)

sysWrite

public static void sysWrite(MemberReference mr)

sysWriteln

public static void sysWriteln()

sysWrite

public static void sysWrite(char c)

sysWriteField

public static void sysWriteField(int w,
                                 int v)

sysWriteField

public static void sysWriteField(int w,
                                 String s)

sysWriteHex

public static void sysWriteHex(int v)

sysWriteHex

public static void sysWriteHex(long v)

sysWriteHex

public static void sysWriteHex(Address v)

sysWriteInt

public static void sysWriteInt(int v)

sysWriteLong

public static void sysWriteLong(long v)

sysWrite

public static void sysWrite(double d,
                            int p)

sysWrite

public static void sysWrite(double d)

sysWrite

public static void sysWrite(String s)

sysWrite

public static void sysWrite(char[] c,
                            int l)

sysWrite

public static void sysWrite(Address a)

sysWriteln

public static void sysWriteln(Address a)

sysWrite

public static void sysWrite(ObjectReference o)

sysWriteln

public static void sysWriteln(ObjectReference o)

sysWrite

public static void sysWrite(Offset o)

sysWriteln

public static void sysWriteln(Offset o)

sysWrite

public static void sysWrite(Word w)

sysWriteln

public static void sysWriteln(Word w)

sysWrite

public static void sysWrite(Extent e)

sysWriteln

public static void sysWriteln(Extent e)

sysWrite

public static void sysWrite(boolean b)

sysWrite

public static void sysWrite(int i)

sysWriteln

public static void sysWriteln(int i)

sysWriteln

public static void sysWriteln(double d)

sysWriteln

public static void sysWriteln(long l)

sysWriteln

public static void sysWriteln(boolean b)

sysWriteln

public static void sysWriteln(String s)

sysWriteln

public static void sysWriteln(String s,
                              Atom a)

sysWrite

public static void sysWrite(String s,
                            int i)

sysWriteln

public static void sysWriteln(String s,
                              int i)

sysWrite

public static void sysWrite(String s,
                            boolean b)

sysWriteln

public static void sysWriteln(String s,
                              boolean b)

sysWrite

public static void sysWrite(String s,
                            double d)

sysWriteln

public static void sysWriteln(String s,
                              double d)

sysWrite

public static void sysWrite(double d,
                            String s)

sysWriteln

public static void sysWriteln(double d,
                              String s)

sysWrite

public static void sysWrite(String s,
                            long i)

sysWriteln

public static void sysWriteln(String s,
                              long i)

sysWriteln

public static void sysWriteln(String s1,
                              long i1,
                              String s2,
                              long i2)

sysWrite

public static void sysWrite(int i,
                            String s)

sysWriteln

public static void sysWriteln(int i,
                              String s)

sysWrite

public static void sysWrite(String s1,
                            String s2)

sysWriteln

public static void sysWriteln(String s1,
                              String s2)

sysWrite

public static void sysWrite(String s,
                            Address a)

sysWriteln

public static void sysWriteln(String s,
                              Address a)

sysWrite

public static void sysWrite(String s,
                            ObjectReference r)

sysWriteln

public static void sysWriteln(String s,
                              ObjectReference r)

sysWrite

public static void sysWrite(String s,
                            Offset o)

sysWriteln

public static void sysWriteln(String s,
                              Offset o)

sysWrite

public static void sysWrite(String s,
                            Word w)

sysWriteln

public static void sysWriteln(String s,
                              Word w)

sysWrite

public static void sysWrite(String s1,
                            String s2,
                            Address a)

sysWrite

public static void sysWrite(String s1,
                            Address a,
                            String s2)

sysWriteln

public static void sysWriteln(String s1,
                              String s2,
                              Address a)

sysWriteln

public static void sysWriteln(String s1,
                              Address a,
                              String s2)

sysWriteln

public static void sysWriteln(String s1,
                              Address a1,
                              Address a2)

sysWrite

public static void sysWrite(String s1,
                            String s2,
                            int i)

sysWriteln

public static void sysWriteln(int i,
                              Address a,
                              RVMMethod m)

sysWriteln

public static void sysWriteln(int i,
                              Address a,
                              Address b)

sysWriteln

public static void sysWriteln(String s1,
                              String s2,
                              int i)

sysWrite

public static void sysWrite(String s1,
                            int i,
                            String s2)

sysWriteln

public static void sysWriteln(String s1,
                              int i,
                              String s2)

sysWrite

public static void sysWrite(String s1,
                            Offset o,
                            String s2)

sysWriteln

public static void sysWriteln(String s1,
                              Offset o,
                              String s2)

sysWrite

public static void sysWrite(String s1,
                            String s2,
                            String s3)

sysWriteln

public static void sysWriteln(String s1,
                              String s2,
                              String s3)

sysWriteln

public static void sysWriteln(String s1,
                              String s2,
                              String s3,
                              Address a)

sysWrite

public static void sysWrite(int i1,
                            String s,
                            int i2)

sysWriteln

public static void sysWriteln(int i1,
                              String s,
                              int i2)

sysWrite

public static void sysWrite(int i1,
                            String s1,
                            String s2)

sysWriteln

public static void sysWriteln(int i1,
                              String s1,
                              String s2)

sysWrite

public static void sysWrite(String s1,
                            String s2,
                            String s3,
                            String s4)

sysWriteln

public static void sysWriteln(String s1,
                              String s2,
                              String s3,
                              String s4)

sysWrite

public static void sysWrite(String s1,
                            String s2,
                            String s3,
                            String s4,
                            String s5)

sysWriteln

public static void sysWriteln(String s1,
                              String s2,
                              String s3,
                              String s4,
                              String s5)

sysWriteln

public static void sysWriteln(String s1,
                              int i,
                              String s3,
                              Address a,
                              String s5)

sysWriteln

public static void sysWriteln(int i,
                              String s,
                              Address a)

sysWrite

public static void sysWrite(String s1,
                            int i1,
                            String s2,
                            int i2)

sysWriteln

public static void sysWriteln(String s1,
                              int i1,
                              String s2,
                              int i2)

sysWriteln

public static void sysWriteln(String s1,
                              int i,
                              String s2,
                              Address a)

sysWriteln

public static void sysWriteln(String s1,
                              int i,
                              String s2,
                              Word w)

sysWriteln

public static void sysWriteln(String s1,
                              int i,
                              String s2,
                              double d)

sysWriteln

public static void sysWriteln(String s1,
                              int i,
                              String s2,
                              Word w,
                              String s3)

sysWriteln

public static void sysWriteln(String s1,
                              int i1,
                              String s2,
                              int i2,
                              String s3)

sysWriteln

public static void sysWriteln(String s1,
                              int i1,
                              String s2,
                              int i2,
                              String s3,
                              int i3)

sysWrite

public static void sysWrite(String s1,
                            int i1,
                            String s2,
                            long l1)

sysWriteln

public static void sysWriteln(String s1,
                              int i1,
                              String s2,
                              long l1)

sysWrite

public static void sysWrite(String s1,
                            Offset o,
                            String s2,
                            int i)

sysWriteln

public static void sysWriteln(String s1,
                              Offset o,
                              String s2,
                              int i)

sysWrite

public static void sysWrite(String s1,
                            double d,
                            String s2)

sysWriteln

public static void sysWriteln(String s1,
                              double d,
                              String s2)

sysWriteln

public static void sysWriteln(String s1,
                              long l1,
                              String s2,
                              long l2,
                              String s3)

sysWrite

public static void sysWrite(String s1,
                            String s2,
                            int i1,
                            String s3)

sysWriteln

public static void sysWriteln(String s1,
                              String s2,
                              int i1,
                              String s3)

sysWrite

public static void sysWrite(String s1,
                            String s2,
                            String s3,
                            int i1)

sysWriteln

public static void sysWriteln(String s1,
                              String s2,
                              String s3,
                              int i1)

sysWrite

public static void sysWrite(String s1,
                            String s2,
                            String s3,
                            String s4,
                            int i5,
                            String s6)

sysWriteln

public static void sysWriteln(String s1,
                              String s2,
                              String s3,
                              String s4,
                              int i5,
                              String s6)

sysWrite

public static void sysWrite(int i,
                            String s1,
                            double d,
                            String s2)

sysWriteln

public static void sysWriteln(int i,
                              String s1,
                              double d,
                              String s2)

sysWrite

public static void sysWrite(String s1,
                            String s2,
                            String s3,
                            int i1,
                            String s4)

sysWriteln

public static void sysWriteln(String s1,
                              String s2,
                              String s3,
                              int i1,
                              String s4)

sysWrite

public static void sysWrite(String s1,
                            Address a1,
                            String s2,
                            Address a2)

sysWriteln

public static void sysWriteln(String s1,
                              Address a1,
                              String s2,
                              Address a2)

sysWrite

public static void sysWrite(String s1,
                            Address a,
                            String s2,
                            int i)

sysWriteln

public static void sysWriteln(String s1,
                              Address a,
                              String s2,
                              int i)

sysWriteln

public static void sysWriteln(String s0,
                              Address a1,
                              String s1,
                              Word w1,
                              String s2,
                              int i1,
                              String s3,
                              int i2,
                              String s4,
                              Word w2,
                              String s5,
                              int i3)

showThread

private static void showThread()

tsysWriteln

public static void tsysWriteln(String s)

tsysWriteln

public static void tsysWriteln(String s1,
                               String s2,
                               String s3,
                               int i4,
                               String s5,
                               String s6)

tsysWriteln

public static void tsysWriteln(String s1,
                               String s2,
                               String s3,
                               String s4,
                               String s5,
                               String s6,
                               String s7,
                               int i8,
                               String s9,
                               String s10,
                               String s11,
                               String s12,
                               String s13)

tsysWriteln

public static void tsysWriteln(String s1,
                               String s2,
                               String s3,
                               String s4,
                               String s5,
                               String s6,
                               String s7,
                               int i8,
                               String s9,
                               String s10,
                               String s11,
                               String s12,
                               String s13,
                               int i14)

tsysWrite

public static void tsysWrite(char[] c,
                             int l)

tsysWriteln

public static void tsysWriteln(Address a)

tsysWriteln

public static void tsysWriteln(String s,
                               int i)

tsysWriteln

public static void tsysWriteln(String s,
                               Address a)

tsysWriteln

public static void tsysWriteln(String s1,
                               Address a1,
                               String s2,
                               Address a2)

tsysWriteln

public static void tsysWriteln(String s1,
                               Address a1,
                               String s2,
                               Address a2,
                               String s3,
                               Address a3)

tsysWriteln

public static void tsysWriteln(String s1,
                               Address a1,
                               String s2,
                               Address a2,
                               String s3,
                               Address a3,
                               String s4,
                               Address a4)

tsysWriteln

public static void tsysWriteln(String s1,
                               Address a1,
                               String s2,
                               Address a2,
                               String s3,
                               Address a3,
                               String s4,
                               Address a4,
                               String s5,
                               Address a5)

bugReportMessage

public static void bugReportMessage()
Produce a message requesting a bug report be submitted


sysFail

public static void sysFail(String message)
Exit virtual machine due to internal failure of some sort.

Parameters:
message - error message describing the problem

sysFail

public static void sysFail(String message,
                           int number)
Exit virtual machine due to internal failure of some sort. This two-argument form is needed for us to call before the VM's Integer class is initialized.

Parameters:
message - error message describing the problem
number - an integer to append to message.

sysExit

public static void sysExit(int value)
Exit virtual machine.

Parameters:
value - value to pass to host o/s

shutdown

public static void shutdown(int value)
Shut down the virtual machine. Should only be called if the VM is running.

Parameters:
value - exit value

sysFailInProgress

public static boolean sysFailInProgress()

handlePossibleRecursiveCallToSysFail

private static void handlePossibleRecursiveCallToSysFail(String message)

handlePossibleRecursiveCallToSysFail

private static void handlePossibleRecursiveCallToSysFail(String message,
                                                         int number)

handlePossibleRecursiveCallToSysExit

private static void handlePossibleRecursiveCallToSysExit()

handlePossibleRecursiveShutdown

private static void handlePossibleRecursiveShutdown()
Used only by VM.shutdown()


handlePossibleRecursiveExit

private static void handlePossibleRecursiveExit(String called,
                                                int depth)

handlePossibleRecursiveExit

private static void handlePossibleRecursiveExit(String called,
                                                int depth,
                                                String message)

handlePossibleRecursiveExit

private static void handlePossibleRecursiveExit(String called,
                                                int depth,
                                                String message,
                                                int number)

handlePossibleRecursiveExit

private static void handlePossibleRecursiveExit(String called,
                                                int depth,
                                                String message,
                                                boolean showNumber,
                                                int number)
Parameters:
called - Name of the function called: "sysExit", "sysFail", or "shutdown".
depth - How deep are we in that function?
message - What message did it have? null means this particular shutdown function does not come with a message.
showNumber - Print number following message?
number - Print this number, if showNumber is true.

dieAbruptlyRecursiveSystemTrouble

public static void dieAbruptlyRecursiveSystemTrouble()

init

private static void init(String bootstrapClasspath,
                         String[] bootCompilerArgs)
Create class instances needed for boot image or initialize classes needed by tools.

Parameters:
bootstrapClasspath - places where VM implementation class reside
bootCompilerArgs - command line arguments to pass along to the boot compiler's init routine.

disableYieldpoints

public static void disableYieldpoints()

enableYieldpoints

public static void enableYieldpoints()

disableGC

public static void disableGC()
The disableGC() and enableGC() methods are for use as guards to protect code that must deal with raw object addresses in a collection-safe manner (i.e. code that holds raw pointers across "gc-sites").

Authors of code running while GC is disabled must be certain not to allocate objects explicitly via "new", or implicitly via methods that, in turn, call "new" (such as string concatenation expressions that are translated by the java compiler into String() and StringBuffer() operations). Furthermore, to prevent deadlocks, code running with GC disabled must not lock any objects. This means the code must not execute any bytecodes that require runtime support (e.g. via RuntimeEntrypoints) such as:

Recommendation: as a debugging aid, Allocator implementations should test "Thread.disallowAllocationsByThisThread" to verify that they are never called while GC is disabled.


disableGC

public static void disableGC(boolean recursiveOK)
disableGC: Disable GC if it hasn't already been disabled. This enforces a stack discipline; we need it for the JNI Get*Critical and Release*Critical functions. Should be matched with a subsequent call to enableGC().


enableGC

public static void enableGC()
enable GC; entry point when recursion is not OK.


enableGC

public static void enableGC(boolean recursiveOK)
enableGC(): Re-Enable GC if we're popping off the last possibly-recursive disableGC() request. This enforces a stack discipline; we need it for the JNI Get*Critical and Release*Critical functions. Should be matched with a preceding call to disableGC().


buildFor32Addr

public static boolean buildFor32Addr()
Is this a build for 32bit addressing? NB. this method is provided to give a hook to the IA32 assembler that won't be compiled away by javac


buildForSSE2

public static boolean buildForSSE2()
Is this a build for SSE2? NB. this method is provided to give a hook to the IA32 assembler that won't be compiled away by javac