} if ((VM_Controller.options.ENABLE_ADVICE_GENERATION) && (cm.getCompilerType() == VM_CompiledMethod.BASELINE) && VM_Controller.enabled) { VM_AOSGenerator.baseCompilationCompleted(cm);
  public static VM_CompiledMethod compile(VM_NormalMethod method) {    //-#if RVM_WITH_QUICK_RUNTIME_COMPILER    VM_CompiledMethod cm;    cm = quickCompileWithFallBack(method);    return cm;    //-#elif RVM_WITH_ADAPTIVE_SYSTEM    VM_CompiledMethod cm;    if (!VM_Controller.enabled) {      // System still early in boot process; compile with baseline compiler      cm = baselineCompile(method);      VM_ControllerMemory.incrementNumBase();    } else {      if (!preloadChecked) {        preloadChecked = true;                  // prevent subsequent calls        // N.B. This will use irc options        if (VM_BaselineCompiler.options.PRELOAD_CLASS != null) {          compilationInProgress = true;         // use baseline during preload          // Other than when boot options are requested (processed during preloadSpecialClass          // It is hard to communicate options for these special compilations. Use the           // default options and at least pick up the verbose if requested for base/irc          OPT_Options tmpoptions = (OPT_Options)options.clone();          tmpoptions.PRELOAD_CLASS = VM_BaselineCompiler.options.PRELOAD_CLASS;          tmpoptions.PRELOAD_AS_BOOT = VM_BaselineCompiler.options.PRELOAD_AS_BOOT;          if (VM_BaselineCompiler.options.PRINT_METHOD) {            tmpoptions.PRINT_METHOD = true;          } else {            tmpoptions = options;          }          OPT_Compiler.preloadSpecialClass(tmpoptions);          compilationInProgress = false;        }      }      if (VM_Controller.options.optIRC()) {        if (// will only run once: don't bother optimizing            method.isClassInitializer() ||             // exception in progress. can't use opt compiler:             // it uses exceptions and runtime doesn't support             // multiple pending (undelivered) exceptions [--DL]            VM_Thread.getCurrentThread().hardwareExceptionRegisters.inuse) {          // compile with baseline compiler          cm = baselineCompile(method);          VM_ControllerMemory.incrementNumBase();        } else { // compile with opt compiler          VM_AOSInstrumentationPlan instrumentationPlan =             new VM_AOSInstrumentationPlan(VM_Controller.options, method);          OPT_CompilationPlan compPlan =             new OPT_CompilationPlan(method, optimizationPlan,                                     instrumentationPlan, options);          if (offlineInlineOracle != null) {            compPlan.setInlineOracle(offlineInlineOracle);          }          cm = optCompileWithFallBack(method, compPlan);        }        //-#if RVM_WITH_QUICK_COMPILER        } else if (VM_Controller.options.optIRC()) {        if (VM_Controller.options.BACKGROUND_RECOMPILATION) {          // must be an inital compilation: compile with baseline compiler          cm = baselineCompile(method);          VM_ControllerMemory.incrementNumBase();        } else {          // check to see if there is a compilation plan for this method.          VM_ControllerPlan plan = VM_ControllerMemory.findLatestPlan(method);          if (plan == null || plan.getStatus() != VM_ControllerPlan.IN_PROGRESS) {            // initial compilation or some other funny state: compile with baseline compiler            cm = baselineCompile(method);            VM_ControllerMemory.incrementNumBase();          } else {            cm = plan.doRecompile();            if (cm == null) {              // opt compilation aborted for some reason.              cm = baselineCompile(method);            }          }                   }        //-#endif      } else {        if (VM_Controller.options.BACKGROUND_RECOMPILATION) {          // must be an inital compilation: compile with baseline compiler          cm = baselineCompile(method);          VM_ControllerMemory.incrementNumBase();        } else {          // check to see if there is a compilation plan for this method.          VM_ControllerPlan plan = VM_ControllerMemory.findLatestPlan(method);          if (plan == null || plan.getStatus() != VM_ControllerPlan.IN_PROGRESS) {            // initial compilation or some other funny state: compile with baseline compiler            cm = baselineCompile(method);            VM_ControllerMemory.incrementNumBase();          } else {            cm = plan.doRecompile();            if (cm == null) {              // opt compilation aborted for some reason.              cm = baselineCompile(method);            }          }                   }      }    }    if (VM.LogAOSEvents) {      VM_AOSLogging.recordCompileTime(cm, 0.0);    }    return cm;    //-#else    return baselineCompile(method);    //-#endif  }