VM_Class.OptCLDepManager.addNotOverriddenDependency(staticCallee, state.getCompiledMethod());
cldm.addNotOverriddenDependency(staticCallee, state.getCompiledMethod());
          public void visit(VM_Method callee, double weight) {            if (hasBody(callee)) {              if (verbose) {                VM.sysWriteln("\tEvaluating target "+callee+" with "+weight+                              " samples ("+(100*VM_AdaptiveInlining.adjustedWeight(weight))+"%)");              }              // Don't inline recursively and respect no inline pragmas              OPT_InlineSequence seq = state.getSequence();              if (seq.containsMethod(callee)) {                if (verbose) VM.sysWriteln("\t\tReject: recursive");                return;              }              if (hasNoInlinePragma(callee, state)) {                if (verbose) VM.sysWriteln("\t\tReject: noinline pragma");                return;              }              // more or less figure out the guard situation early -- impacts size estimate.              boolean needsGuard = !state.getHasPreciseTarget() && (staticCallee != callee || needsGuard(staticCallee));              if (needsGuard && isForbiddenSpeculation(state.getRootMethod(), callee)) {                if (verbose) VM.sysWriteln("\t\tReject: forbidden speculation");                return;              }              boolean currentlyFinal =                (goosc || (staticCallee == callee)) && isCurrentlyFinal(callee,                                                                        !opts.guardWithClassTest());              boolean preEx = needsGuard && state.getIsExtant() && opts.PREEX_INLINE && currentlyFinal;              if (needsGuard && !preEx) {                if (!opts.GUARDED_INLINE) {                  if (verbose) VM.sysWriteln("\t\tReject: guarded inlining disabled");                  return;                }                if (!currentlyFinal && ps) {                  if (verbose) VM.sysWriteln("\t\tReject: multiple targets and no profile data");                  return;                }              }                            // Estimate cost of performing this inlining action.              // Includes cost of guard & off-branch call if they are going to be generated.              boolean decideYes = false;              if (hasInlinePragma(callee, state)) {                if (verbose) VM.sysWriteln("\t\tSelect: pragma inline");                decideYes = true;              } else {                // Preserve previous inlining decisions                // Not the best thing in the world due to phase shifts, but                // it does buy some degree of stability. So, it is probably the lesser                // of two evils.                VM_CompiledMethod prev = state.getRootMethod().getCurrentCompiledMethod();                if (prev != null && prev.getCompilerType() == VM_CompiledMethod.OPT) {                  if (((VM_OptCompiledMethod)prev).getMCMap().hasInlinedEdge(caller, bcIndex, callee)) {                    if (verbose) VM.sysWriteln("\t\tSelect: Previously inlined");                    decideYes = true;                  }                }                if (!decideYes) {                  int inlinedSizeEstimate = inlinedSizeEstimate((VM_NormalMethod)callee, state);                  int cost = inliningActionCost(inlinedSizeEstimate, needsGuard, preEx, opts);                  int maxCost = opts.IC_MAX_TARGET_SIZE;                  if (callSiteWeight > VM_Controller.options.AI_SEED_MULTIPLIER) {                    // real profile data with enough samples for us to trust it.                    // Use weight and shape of call site distrubution to compute                    // a higher maxCost.                    double fractionOfSample = weight/callSiteWeight;                    if (needsGuard && fractionOfSample < opts.AI_MIN_CALLSITE_FRACTION) {                      // This call accounts for less than AI_MIN_CALLSITE_FRACTION                      // of the profiled targets at this call site.                      // It is highly unlikely to be profitable to inline it.                      if (verbose) VM.sysWriteln("\t\tReject: less than AI_MIN_CALLSITE_FRACTION of distribution");                      maxCost = 0;                    } else {                      if (cost > maxCost) {                        // adjust up based on weight of callsite                        double adjustedWeight = VM_AdaptiveInlining.adjustedWeight(weight);                        if (adjustedWeight > VM_Controller.options.AI_CONTROL_POINT) {                          maxCost = opts.AI_MAX_TARGET_SIZE;                        } else {                          int range = opts.AI_MAX_TARGET_SIZE - opts.IC_MAX_TARGET_SIZE;                          double slope = ((double)range) / VM_Controller.options.AI_CONTROL_POINT;                          int sizeAdj = (int) (slope * adjustedWeight);                          maxCost += sizeAdj;                        }                      }                    }                  }                  // Somewhat bogus, but if we get really deeply inlined we start backing off.                  int curDepth = state.getInlineDepth();                  if (curDepth > opts.IC_MAX_INLINE_DEPTH) {                    maxCost /= (curDepth - opts.IC_MAX_INLINE_DEPTH + 1);                  }                                    decideYes = cost <= maxCost;                  if (verbose) {                    if (decideYes) {                      VM.sysWriteln("\t\tAccept: cost of "+cost+" was below threshold "+maxCost);                    } else {                      VM.sysWriteln("\t\tReject: cost of "+cost+" was above threshold "+maxCost);                    }                  }                }              }              if (decideYes) {                // Ok, we're going to inline it.                // Record that and also whether or not we think it needs a guard.                methodsToInline.add(callee);                if (preEx) {                  if (OPT_ClassLoadingDependencyManager.TRACE ||                       OPT_ClassLoadingDependencyManager.DEBUG) {                    VM_Class.OptCLDepManager.report("PREEX_INLINE: Inlined "                                                    + callee + " into " + caller + "\n");                  }                  VM_Class.OptCLDepManager.addNotOverriddenDependency(callee, state.getCompiledMethod());                  if (goosc) {                    VM_Class.OptCLDepManager.addNotOverriddenDependency(staticCallee, state.getCompiledMethod());                  }                  methodsNeedGuard.add(Boolean.FALSE);                } else {                  methodsNeedGuard.add(Boolean.valueOf(needsGuard));                }              }            }          }