VM_EdgeCounts.boot();
  private static void finishBooting() throws InterruptiblePragma {        // get pthread_id from OS and store into vm_processor field    //     if (!singleVirtualProcessor) {      VM_SysCall.sysPthreadSetupSignalHandling();      VM_Processor.getCurrentProcessor().pthread_id =         VM_SysCall.sysPthreadSelf();    }    // Set up buffer locks used by VM_Thread for logging and status dumping.    //    This can happen at any point before we start running    //    multi-threaded.      VM_Thread.boot();    // Initialize memory manager's virtual processor local state.    // This must happen before any putfield or arraystore of object refs    // because the buffer is accessed by compiler-generated write barrier code.    //    if (verboseBoot >= 1) VM.sysWriteln("Setting up write barrier");    MM_Interface.setupProcessor(VM_Processor.getCurrentProcessor());        // Initialize memory manager.    //    This must happen before any uses of "new".    //    if (verboseBoot >= 1) VM.sysWriteln("Setting up memory manager: bootrecord = ", VM_Magic.objectAsAddress(VM_BootRecord.the_boot_record));    MM_Interface.boot(VM_BootRecord.the_boot_record);        // Start calculation of cycles to millsecond conversion factor    if (verboseBoot >= 1) VM.sysWriteln("Stage one of booting VM_Time");    VM_Time.bootStageOne();    // Reset the options for the baseline compiler to avoid carrying     // them over from bootimage writing time.    //     if (verboseBoot >= 1) VM.sysWriteln("Initializing baseline compiler options to defaults");    VM_BaselineCompiler.initOptions();    //-#if RVM_WITH_QUICK_COMPILER    // Reset the options for the quick compiler to avoid carrying     // them over from bootimage writing time.    //     if (verboseBoot >= 1) VM.sysWriteln("Initializing quick compiler options to defaults");    VM_QuickCompiler.initOptions();    //-#endif    // Create class objects for static synchronized methods in the bootimage.    // This must happen before any static synchronized methods of bootimage     // classes can be invoked.    if (verboseBoot >= 1) VM.sysWriteln("Creating class objects for static synchronized methods");    createClassObjects();    // Fetch arguments from program command line.    //    if (verboseBoot >= 1) VM.sysWriteln("Fetching command-line arguments");    VM_CommandLineArgs.fetchCommandLineArguments();    // Process most virtual machine command line arguments.    //    if (verboseBoot >= 1) VM.sysWriteln("Early stage processing of command line");    VM_CommandLineArgs.earlyProcessCommandLineArguments();    // Allow Memory Manager to respond to its command line arguments    //    if (verboseBoot >= 1) VM.sysWriteln("Collector processing rest of boot options");    MM_Interface.postBoot();    // Initialize class loader.    //    if (verboseBoot >= 1) VM.sysWriteln("Initializing bootstrap class loader");    String bootstrapClasses = VM_CommandLineArgs.getBootstrapClasses();    VM_ClassLoader.boot();      // Wipe out cached application class loader    VM_BootstrapClassLoader.boot(bootstrapClasses);    VM_ApplicationClassLoader2.boot(".");    // Complete calculation of cycles to millsecond conversion factor    // Must be done before any dynamic compilation occurs.    if (verboseBoot >= 1) VM.sysWriteln("Stage two of booting VM_Time");    VM_Time.bootStageTwo();    // Initialize statics that couldn't be placed in bootimage, either     // because they refer to external state (open files), or because they     // appear in fields that are unique to Jikes RVM implementation of     // standard class library (not part of standard jdk).    // We discover the latter by observing "host has no field" and     // "object not part of bootimage" messages printed out by bootimage     // writer.    //    if (verboseBoot >= 1) VM.sysWriteln("Running various class initializers");    //-#if RVM_WITH_CLASSPATH_0_10 || RVM_WITH_CLASSPATH_0_11 || RVM_WITH_CLASSPATH_0_12    //-#else    runClassInitializer("gnu.classpath.SystemProperties"); // only in 0.13 and later    //-#endif        runClassInitializer("java.lang.Runtime");    //-#if RVM_WITH_CLASSPATH_0_12    // Classpath 0.12    java.lang.JikesRVMSupport.javaLangSystemEarlyInitializers();    //-#else  // 0.10, 0.11, 0.13, and post-0.13    // In 0.10 and 0.11, requires ClassLoader and ApplicationClassLoader    runClassInitializer("java.lang.System");     //-#endif    runClassInitializer("java.lang.Void");    runClassInitializer("java.lang.Boolean");    runClassInitializer("java.lang.Byte");    runClassInitializer("java.lang.Short");    runClassInitializer("java.lang.Number");    runClassInitializer("java.lang.Integer");    runClassInitializer("java.lang.Long");    runClassInitializer("java.lang.Float");    runClassInitializer("java.lang.Character");    runClassInitializer("java.util.WeakHashMap"); // Need for ThreadLocal    // Turn off security checks; about to hit EncodingManager.    // Commented out because we haven't incorporated this into the CVS head    // yet.     // java.security.JikesRVMSupport.turnOffChecks();    runClassInitializer("java.lang.Thread");    runClassInitializer("java.lang.ThreadGroup");    /* We can safely allocate a java.lang.Thread now.  The boot       thread (running right now, as a VM_Thread) has to become a full-fledged       Thread, since we're about to encounter a security check:       EncodingManager checks a system property,         which means that the permissions checks have to be working,        which means that VMAccessController will be invoked,        which means that ThreadLocal.get() will be called,        which calls Thread.getCurrentThread().        So the boot VM_Thread needs to be associated with a real Thread for        Thread.getCurrentThread() to return. */    VM.safeToAllocateJavaThread = true;    VM_Scheduler.giveBootVM_ThreadAJavaLangThread();    runClassInitializer("java.lang.ThreadLocal");    // Possibly fix VMAccessController's contexts and inGetContext fields    runClassInitializer("java.security.VMAccessController");        runClassInitializer("java.io.File"); // needed for when we initialize the                                         // system/application class loader.    runClassInitializer("gnu.java.lang.SystemClassLoader");    runClassInitializer("java.lang.String");    runClassInitializer("java.lang.VMString");    runClassInitializer("gnu.java.security.provider.DefaultPolicy");    runClassInitializer("java.security.Policy");    runClassInitializer("java.net.URL"); // needed for URLClassLoader    /* Needed for ApplicationClassLoader, which in turn is needed by       VMClassLoader.getSystemClassLoader()  */    runClassInitializer("java.net.URLClassLoader");     /* Used if we start up Jikes RVM with the -jar argument; that argument     * means that we need a working -jar before we can return an     * Application Class Loader. */    runClassInitializer("gnu.java.net.protocol.jar.Connection$JarFileCache");    // Calls System.getProperty().  However, the only thing it uses the    // property for is to set the default protection domain, and THAT is only    // used in defineClass.  So, since we haven't needed to call defineClass    // up to this point, we are OK deferring its proper re-initialization.    runClassInitializer("java.lang.ClassLoader");     /* Here, we lie and pretend to have a working app class loader, since we       need it in order to run other initializers properly! */    //-#if RVM_WITH_CLASSPATH_0_10 || RVM_WITH_CLASSPATH_0_11    //-#elif RVM_WITH_CLASSPATH_0_12    java.lang.JikesRVMSupport.javaLangSystemLateInitializers();    //-#else    /** This one absolutely requires that we have a working Application/System        class loader, or at least a returnable one.  That, in turn, requires        lots of things be set up for Jar.  */    runClassInitializer("java.lang.ClassLoader$StaticData");    //-#endif    runClassInitializer("gnu.java.io.EncodingManager"); // uses System.getProperty    runClassInitializer("java.nio.charset.CharsetEncoder");    runClassInitializer("java.nio.charset.CharsetDecoder");    runClassInitializer("java.nio.charset.CharsetCoderResult");    runClassInitializer("java.io.PrintWriter"); // Uses System.getProperty    runClassInitializer("java.lang.Math"); /* Load in the javalang library, so                                              that Math's native trig functions                                              work.  Still can't use them                                              until JNI is set up. */     runClassInitializer("java.util.SimpleTimeZone");    runClassInitializer("java.util.TimeZone");    runClassInitializer("java.util.Locale");    runClassInitializer("java.util.Calendar");    runClassInitializer("java.util.GregorianCalendar");    runClassInitializer("java.util.ResourceBundle");    runClassInitializer("java.util.zip.ZipEntry");    runClassInitializer("java.util.zip.Inflater");    runClassInitializer("java.util.zip.DeflaterHuffman");    runClassInitializer("java.util.zip.InflaterDynHeader");    runClassInitializer("java.util.zip.InflaterHuffmanTree");    runClassInitializer("gnu.java.locale.Calendar");    runClassInitializer("java.util.Date");    //-#if RVM_WITH_ALL_CLASSES    runClassInitializer("java.util.jar.Attributes$Name");    //-#endif    if (verboseBoot >= 1) VM.sysWriteln("Booting VM_Lock");    VM_Lock.boot();        // set up HPM    //-#if RVM_WITH_HPM    if (BuildForHPM) {      if (VM_HardwarePerformanceMonitors.enabled()) {        // assume only one Java thread is executing!        if(VM_HardwarePerformanceMonitors.verbose>=2)          VM.sysWriteln("VM.boot() call VM_HardwarePerformanceMonitors.boot()");        VM_HardwarePerformanceMonitors.boot();      }    }    //-#endif    // Enable multiprocessing.    // Among other things, after this returns, GC and dynamic class loading are enabled.    //     if (verboseBoot >= 1) VM.sysWriteln("Booting scheduler");    VM_Scheduler.boot();    VM.dynamicClassLoadingEnabled = true;    // Create JNI Environment for boot thread.      // After this point the boot thread can invoke native methods.    com.ibm.JikesRVM.jni.VM_JNIEnvironment.boot();    if (verboseBoot >= 1) VM.sysWriteln("Initializing JNI for boot thread");    VM_Thread.getCurrentThread().initializeJNIEnv();    //-#if RVM_WITH_HPM    runClassInitializer("com.ibm.JikesRVM.Java2HPM");    VM_HardwarePerformanceMonitors.setUpHPMinfo();    //-#endif    // Run class intializers that require JNI    if (verboseBoot >= 1) VM.sysWriteln("Running late class initializers");    runClassInitializer("gnu.java.nio.channels.FileChannelImpl");    runClassInitializer("java.io.FileDescriptor");    runClassInitializer("java.lang.Double");    runClassInitializer("java.util.PropertyPermission");    runClassInitializer("com.ibm.JikesRVM.VM_Process");    runClassInitializer("java.io.VMFile"); // Load libjavaio.so    // Initialize java.lang.System.out, java.lang.System.err, java.lang.System.in    VM_FileSystem.initializeStandardStreams();    ///////////////////////////////////////////////////////////////    // The VM is now fully booted.                               //    // By this we mean that we can execute arbitrary Java code.  //    ///////////////////////////////////////////////////////////////    if (verboseBoot >= 1) VM.sysWriteln("VM is now fully booted");        // Inform interested subsystems that VM is fully booted.    VM.fullyBooted = true;    MM_Interface.fullyBootedVM();    VM_BaselineCompiler.fullyBootedVM();    //-#if RVM_WITH_QUICK_COMPILER    VM_QuickCompiler.fullyBootedVM();    //-#endif    // Allow profile information to be read in from a file    //     VM_EdgeCounts.boot();    // Initialize compiler that compiles dynamically loaded classes.    //    if (verboseBoot >= 1) VM.sysWriteln("Initializing runtime compiler");    VM_RuntimeCompiler.boot();    // Process remainder of the VM's command line arguments.    if (verboseBoot >= 1) VM.sysWriteln("Late stage processing of command line");    String[] applicationArguments = VM_CommandLineArgs.lateProcessCommandLineArguments();    if (VM.verboseClassLoading || verboseBoot >= 1) VM.sysWrite("[VM booted]\n");    // set up JikesRVM socket I/O    if (verboseBoot >= 1) VM.sysWriteln("Initializing socket factories");    JikesRVMSocketImpl.boot();    //-#if RVM_WITH_ADAPTIVE_SYSTEM    if (verboseBoot >= 1) VM.sysWriteln("Initializing adaptive system");    com.ibm.JikesRVM.adaptive.VM_Controller.boot();    //-#endif    // The first argument must be a class name.    if (verboseBoot >= 1) VM.sysWriteln("Extracting name of class to execute");    if (applicationArguments.length == 0) {      pleaseSpecifyAClass();    }    if (applicationArguments.length > 0 &&         ! VM_TypeDescriptorParsing.isJavaClassName(applicationArguments[0])) {      VM.sysWrite("vm: \"");      VM.sysWrite(applicationArguments[0]);      VM.sysWrite("\" is not a legal Java class name.\n");      pleaseSpecifyAClass();    }    if (verboseBoot >= 1) VM.sysWriteln("Initializing Application Class Loader");    VM_ClassLoader.getApplicationClassLoader();    VM_ClassLoader.declareApplicationClassLoaderIsReady();    if (verboseBoot >= 1) VM.sysWriteln("Turning back on security checks.  Letting people see the ApplicationClassLoader.");    // Turn on security checks again.    // Commented out because we haven't incorporated this into the main CVS    // tree yet.     // java.security.JikesRVMSupport.fullyBootedVM();    //-#if RVM_WITH_CLASSPATH_0_10 || RVM_WITH_CLASSPATH_0_11    //-#elif RVM_WITH_CLASSPATH_0_12    java.lang.JikesRVMSupport.javaLangSystemLateInitializers();    //-#else    //    RVM_WITH_CLASSPATH_0_13 || RVM_WITH_CLASSPATH_CVS_HEAD    /** This one absolutely requires that we have a working Application/System        class loader, or at least a returnable one.  That, in turn, requires        lots of things be set up for Jar.  */    runClassInitializer("java.lang.ClassLoader$StaticData");    //-#endif    // Schedule "main" thread for execution.    if (verboseBoot >= 2) VM.sysWriteln("Creating main thread");    // Create main thread.    if (verboseBoot >= 1) VM.sysWriteln("Constructing mainThread");    Thread mainThread = new MainThread(applicationArguments);    // Schedule "main" thread for execution.    if (verboseBoot >= 1) VM.sysWriteln("Starting main thread");    mainThread.start();    if (verboseBoot >= 1) VM.sysWriteln("Starting debugger thread");    // Create one debugger thread.    VM_Thread t = new DebuggerThread();    t.start(VM_Scheduler.debuggerQueue);    //-#if RVM_WITH_HPM    if (VM_HardwarePerformanceMonitors.enabled()) {      // IS THIS NEEDED?      if (!VM_HardwarePerformanceMonitors.thread_group) {        if(VM_HardwarePerformanceMonitors.verbose>=2)          VM.sysWrite(" VM.boot() call sysHPMresetMyThread()\n");        VM_SysCall.sysHPMresetMyThread();      }    }    //-#endif    // End of boot thread.    //    if (VM.TraceThreads) VM_Scheduler.trace("VM.boot", "completed - terminating");    if (verboseBoot >= 2)       VM.sysWriteln("Boot sequence completed; finishing boot thread");        VM_Thread.terminate();    if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED);  }