if (VM_Controller.options.ENABLE_ADVICE_GENERATION && (newCMID != -1)) { VM_AOSGenerator.reCompilationWithOpt(cp); }
  public VM_CompiledMethod doRecompile() {    OPT_CompilationPlan cp = getCompPlan();    setTimeInitiated(VM_Controller.controllerClock);    if (VM.LogAOSEvents) VM_AOSLogging.recompilationStarted(cp);     if (cp.options.PRINT_METHOD) {      VM.sysWrite("-oc:O"+cp.options.getOptLevel()+" \n");    }        // Compile the method.    int newCMID = VM_RuntimeCompiler.recompileWithOpt(cp);    int prevCMID = getPrevCMID();    if (VM_Controller.options.sampling()) {      // transfer the samples from the old CMID to the new CMID.      // scale the number of samples down by the expected speedup       // in the newly compiled method.      double expectedSpeedup = getExpectedSpeedup();      double oldNumSamples = VM_Controller.methodSamples.getData(prevCMID);      double newNumSamples = oldNumSamples / expectedSpeedup;      VM_Controller.methodSamples.reset(prevCMID);      if (newCMID > -1) {        VM_Controller.methodSamples.augmentData(newCMID, newNumSamples);      }    }    // set the status of the plan accordingly    if (newCMID != -1) {      setStatus(VM_ControllerPlan.COMPLETED);    } else {      setStatus(VM_ControllerPlan.ABORTED_COMPILATION_ERROR);    }    setCMID(newCMID);    setTimeCompleted(VM_Controller.controllerClock);    VM_CompiledMethod cm = newCMID == -1 ? null : VM_CompiledMethods.getCompiledMethod(newCMID);    if (VM.LogAOSEvents) {      if (newCMID == -1) {        VM_AOSLogging.recompilationAborted(cp);      } else {        VM_AOSLogging.recompilationCompleted(cp);        VM_AOSLogging.recordCompileTime(cm, getExpectedCompilationTime());      }    }        return cm;  }