VM_CompiledMethod compiledMethod = null;
int callerCMID = buffer[i+1]; compiledMethod   = VM_CompiledMethods.getCompiledMethod(callerCMID); if (compiledMethod == null) continue; VM_Method stackFrameCaller = compiledMethod.getMethod();  int MCOffset = buffer[i+2]; VM_CompilerInfo compilerInfo = compiledMethod.getCompilerInfo();  int bytecodeIndex = -1; VM_Method caller = null;
  void thresholdReached() {    if(DEBUG)      VM.sysWrite("VM_AIByEdgeOrganizer.thresholdReached(): enter and reregister.\n");    VM_AdaptiveInlining.incrementNumYieldPoints(edgeListener.                getTimesUpdateCalled());    for (int i=0; i<bufferSize; i=i+3) {       VM_CompiledMethod compiledMethod = null;       int calleeCMID = buffer[i+0];       compiledMethod   = VM_CompiledMethods.getCompiledMethod(calleeCMID);       if (compiledMethod == null) continue;       VM_Method callee = compiledMethod.getMethod();       if (OPT_InliningUtilities.methodShouldNotBeInlined(callee)) {	  if(DEBUG)VM.sysWrite("  "+callee+" should not be inlined!\n");	  continue;       }       int callerCMID = buffer[i+1];       compiledMethod   = VM_CompiledMethods.getCompiledMethod(callerCMID);       if (compiledMethod == null) continue;       VM_Method stackFrameCaller = compiledMethod.getMethod();              int MCOffset = buffer[i+2];       VM_CompilerInfo compilerInfo = compiledMethod.getCompilerInfo();              int bytecodeIndex = -1;       VM_Method caller = null;       int compilerType = compilerInfo.getCompilerType();       switch (compilerType) {       case VM_CompilerInfo.TRAP:       case VM_CompilerInfo.JNI:	 if (DEBUG) VM.sysWrite("Skipping sample with TRAP/JNI caller");	 continue;       case VM_CompilerInfo.BASELINE:	 {	   VM_BaselineCompilerInfo baseCompilerInfo = 	     (VM_BaselineCompilerInfo)compilerInfo;	   // note: the following call expects the offset in INSTRUCTIONS!	   bytecodeIndex = baseCompilerInfo.findBytecodeIndexForInstruction	     (MCOffset>>VM.LG_INSTRUCTION_WIDTH);	   caller = stackFrameCaller;	 }	 break;       case VM_CompilerInfo.OPT:	 {	   VM_OptCompilerInfo optCompilerInfo = (VM_OptCompilerInfo)compilerInfo;	   VM_OptMachineCodeMap mc_map = optCompilerInfo.getMCMap();	   try {	     bytecodeIndex = mc_map.getBytecodeIndexForMCOffset(MCOffset);	     if (bytecodeIndex == -1) {	       // this can happen we we sample a call                // to a runtimeSerivce routine. 	       // We aren't setup to inline such methods anyways,                // so skip the sample.	       if (DEBUG) VM.sysWrite("  *** SKIP SAMPLE "+				      stackFrameCaller+"@"+compiledMethod+				      " at MC offset "+MCOffset+				      " calling "+callee+				      " due to invalid bytecodeIndex\n");	       continue; // skip sample.	     }	   } catch (java.lang.ArrayIndexOutOfBoundsException e) {	     VM.sysWrite("  ***ERROR: getBytecodeIndexForMCOffset("+MCOffset			 +") ArrayIndexOutOfBounds!\n");	     e.printStackTrace(); caller = stackFrameCaller;	     continue;  // skip sample	   } catch (OPT_OptimizingCompilerException e) {	     VM.sysWrite("***Error: SKIP SAMPLE: can't find bytecode index in OPT compiled "+			 stackFrameCaller+"@"+compiledMethod+" at MC offset "+MCOffset+"!\n");	     continue;  // skip sample	   }	   	   try {	     caller = mc_map.getMethodForMCOffset(MCOffset);	   } catch (java.lang.ArrayIndexOutOfBoundsException e) {	     VM.sysWrite("  ***ERROR: getMethodForMCOffset("			 +MCOffset+") ArrayIndexOutOfBounds!\n");	     e.printStackTrace(); caller = stackFrameCaller;	     continue;	   } catch (OPT_OptimizingCompilerException e) {	     VM.sysWrite("***Error: SKIP SAMPLE: can't find caller in OPT compiled "+			 stackFrameCaller+"@"+compiledMethod+" at MC offset "			 +MCOffset+"!\n");	     continue;  // skip sample	   }	   if (caller == null) {	     VM.sysWrite("  ***ERROR: getMethodForMCOffset("+			 MCOffset+") returned null!\n");	     caller = stackFrameCaller;	     continue;  // skip sample	   }	 }	 break;       }       // increment the call graph edge, adding it if needed       callGraph.incrementEdge(caller, bytecodeIndex, callee);    }    // If using an offline inline plan, don't recompute anything, and don't     // notify the controller.    if (!VM_Controller.options.USE_OFFLINE_INLINE_PLAN) {      // force a recomputation of the current state of hot edges      Vector vectorOfTriples = VM_AdaptiveInlining.recomputeHotEdges();            if(DEBUG) {	VM.sysWrite("\nNew edges found:\n");	for (int i=0; i<vectorOfTriples.size(); i++) {	  VM_CallSiteTriple triple = (VM_CallSiteTriple)                vectorOfTriples.elementAt(i);	  VM.sysWrite((i+1)+": "+triple.toString()+"\n");	}      }            VM_MethodCountSet HM_data = 	VM_Controller.methodSamples.collectHotMethods(VM_Controller.options.MAX_OPT_LEVEL,						      VM_Controller.options.AI_METHOD_HOTNESS_THRESHOLD);      if (VM.LogAOSEvents) 	VM_AOSLogging.AIorganizerFoundHotMethods(HM_data.cmids.length);            findMethodsToRecompile(vectorOfTriples, HM_data);    }    if(DEBUG) callGraph.dump();    // Clear listener and activate it again.    edgeListener.reset();    edgeListener.activate();    if(DEBUG)VM.sysWrite("VM_AIByEdgeOrganizer.thresholdReached(): exit\n");  }  