if (DEBUG_CODE_PATCH) { VM.sysWrite("processors to be synchronized : "); VM.sysWrite(VM_Scheduler.toSyncProcessors, false); VM.sysWrite("\n"); }
if (DEBUG_CODE_PATCH) VM.sysWriteln("processors to be synchronized : ", VM_Scheduler.toSyncProcessors);
  public final void applyCodePatches(VM_CompiledMethod cm) throws VM_PragmaInterruptible {    if (patchMap != null) {      INSTRUCTION[] code = cm.getInstructions();      for (int idx=0; idx<patchMap.length; idx += 2) {        //-#if RVM_FOR_IA32  	VM_Assembler.patchCode(code, patchMap[idx], patchMap[idx+1]);        //-#endif        //        //-#if RVM_FOR_POWERPC        OPT_Assembler.patchCode(code, patchMap[idx], patchMap[idx+1]);        //-#endif      }      //-#if RVM_FOR_POWERPC      /* we need synchronization on PPC to handle the weak memory model.       * before the class loading finish, other processor should get        * synchronized.       */      boolean DEBUG_CODE_PATCH = false;      // let other processors see changes; although really physical processors      // need synchronization, we set each virtual processor to execute      // isync at thread switch point.      VM_Magic.sync();      if (VM_Scheduler.syncObj == null) {	VM_Scheduler.syncObj = new Object();      }      // how may processors to be synchronized      // no current process, no the first dummy processor      VM_Scheduler.toSyncProcessors = VM_Scheduler.numProcessors - 1;      synchronized(VM_Scheduler.syncObj) {		for (int i=0; i<VM_Scheduler.numProcessors; i++) {	  VM_Processor proc = VM_Scheduler.processors[i+1];	  // do not sync the current processor	  if (proc != VM_Processor.getCurrentProcessor()) {	    proc.needsSync = true;	  }	}      }      if (DEBUG_CODE_PATCH) {	VM.sysWrite("processors to be synchronized : ");	VM.sysWrite(VM_Scheduler.toSyncProcessors, false);	VM.sysWrite("\n");      }      // do sync only when necessary       while (VM_Scheduler.toSyncProcessors > 0) {	VM_Thread.getCurrentThread().yield();      }            if (DEBUG_CODE_PATCH) {	VM.sysWrite("all processors get synchronized!\n");      }      //-#endif    }  }