OSR_ObjectHolder.boot();
if (VM.BuildForAdaptiveSystem) { OSR_ObjectHolder.boot(); }
  static void boot () {     if (VM.VerifyAssertions) VM._assert(1 <= numProcessors && numProcessors <= MAX_PROCESSORS);    if (VM.TraceThreads)      trace("VM_Scheduler.boot","numProcessors =", numProcessors);    // Create a VM_Processor object for each virtual cpu that we'll be running.    // Note that the VM_Processor object for the primordial processor    // (the virtual cpu in whose context we are currently running)    // was already created in the boot image by init(), above.    //    VM_Processor [] origProcs = processors;    processors = new VM_Processor[1 + numProcessors];    for (int i = PRIMORDIAL_PROCESSOR_ID; i <= numProcessors; i++) {      VM_Processor p = (i < origProcs.length) ? origProcs[i] : null;      if (p == null) {        processors[i] = new VM_Processor(i);      } else {         processors[i] = p;        //-#if RVM_FOR_IA32        p.jtoc = VM_Magic.getJTOC();  // only needed for EXTRA_PROCS        //-#endif      }    }    // Create one one idle thread per processor.    //    for (int i = 0; i < numProcessors; ++i) {      int pid = i+1;      VM_Thread t = new VM_IdleThread(processors[pid], pid != PRIMORDIAL_PROCESSOR_ID);      processors[pid].idleQueue.enqueue(t);    }    // JNI support    terminated = false;             // the one we're running on    processors[PRIMORDIAL_PROCESSOR_ID].isInitialized = true;     // Create virtual cpu's.    //        if (!VM.singleVirtualProcessor) {      VM_SysCall.sysCreateThreadSpecificDataKeys();      if (!VM.withoutInterceptBlockingSystemCalls) {        /// We now insist on this happening, by using LD_PRELOAD on platforms        /// that support it.  Do it here for backup.        // Enable spoofing of blocking native select calls        System.loadLibrary("syswrap");      }          VM_SysCall.sysInitializeStartupLocks(numProcessors);      if (cpuAffinity != NO_CPU_AFFINITY)        VM_SysCall.sysVirtualProcessorBind(cpuAffinity + PRIMORDIAL_PROCESSOR_ID - 1); // bind it to a physical cpu            for (int i = PRIMORDIAL_PROCESSOR_ID; ++i <= numProcessors; ) {        // create VM_Thread for virtual cpu to execute        //        VM_Thread target = processors[i].idleQueue.dequeue();                // Create a virtual cpu and wait for execution to enter the target's        // code/stack.         // This is done with GC disabled to ensure that the garbage collector        // doesn't move code or stack before the C startoff function has a        // chance to transfer control into the VM image.        //        if (VM.TraceThreads)          trace("VM_Scheduler.boot", "starting processor id", i);        processors[i].activeThread = target;        processors[i].activeThreadStackLimit = target.stackLimit;        target.registerThread(); // let scheduler know that thread is active.        if (VM.BuildForPowerPC) {          //-#if RVM_FOR_POWERPC          // NOTE: It is critical that we acquire the tocPointer explicitly          //       before we start the SysCall sequence. This prevents           //       the opt compiler from generating code that passes the AIX           //       sys toc instead of the RVM jtoc. --dave          Address toc = VM_Magic.getTocPointer();          VM_SysCall.            sysVirtualProcessorCreate(toc,                                      VM_Magic.objectAsAddress(processors[i]),                                      target.contextRegisters.ip,                                       target.contextRegisters.getInnermostFramePointer());          if (cpuAffinity != NO_CPU_AFFINITY)            VM_SysCall.sysVirtualProcessorBind(cpuAffinity + i - 1); // bind it to a physical cpu          //-#endif        } else if (VM.BuildForIA32) {          VM_SysCall.sysVirtualProcessorCreate(VM_Magic.getTocPointer(),                                               VM_Magic.objectAsAddress(processors[i]),                                               target.contextRegisters.ip,                                                target.contextRegisters.getInnermostFramePointer());        }      }      // wait for everybody to start up      //      VM_SysCall.sysWaitForVirtualProcessorInitialization();    }    allProcessorsInitialized = true;    //    for (int i = PRIMORDIAL_PROCESSOR_ID; i <= numProcessors; ++i)    //      processors[i].enableThreadSwitching();    VM_Processor.getCurrentProcessor().enableThreadSwitching();    // Start interrupt driven timeslicer to improve threading fairness and responsiveness.    //    schedulingQuantum = VM.interruptQuantum * VM.schedulingMultiplier;    if (VM.TraceThreads) {      VM.sysWrite("  schedulingQuantum "       +  schedulingQuantum);      VM.sysWrite(" = VM.interruptQuantum "    +VM.interruptQuantum);      VM.sysWrite(" * VM.schedulingMultiplier "+VM.schedulingMultiplier);      VM.sysWriteln();    }    VM_SysCall.sysVirtualProcessorEnableTimeSlicing(VM.interruptQuantum);    // Allow virtual cpus to commence feeding off the work queues.    //    if (! VM.singleVirtualProcessor)      VM_SysCall.sysWaitForMultithreadingStart();    OSR_ObjectHolder.boot();    // Start collector threads on each VM_Processor.    for (int i = 0; i < numProcessors; ++i) {      VM_Thread t = VM_CollectorThread.createActiveCollectorThread(processors[1+i]);      t.start(processors[1+i].readyQueue);    }    // Start the G.C. system.    // Create the FinalizerThread    FinalizerThread tt = new FinalizerThread();    tt.makeDaemon(true);    tt.start();    // Store VM_Processor in pthread    VM_SysCall.sysStashVmProcessorInPthread(VM_Processor.getCurrentProcessor());  }