VM_AdaptiveInlining.incrementNumYieldPoints(edgeListener. getTimesUpdateCalled());
VM_AdaptiveInlining.incrementNumYieldPoints(((VM_EdgeListener)listener).getTimesUpdateCalled());
  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) {      int calleeCMID = buffer[i+0];      VM_CompiledMethod compiledMethod   = VM_CompiledMethods.getCompiledMethod(calleeCMID);      if (compiledMethod == null) continue;      VM_Method callee = compiledMethod.getMethod();      int callerCMID = buffer[i+1];      compiledMethod   = VM_CompiledMethods.getCompiledMethod(callerCMID);      if (compiledMethod == null) continue;      VM_Method stackFrameCaller = compiledMethod.getMethod();             int MCOffset = buffer[i+2];      int bytecodeIndex = -1;      VM_Method caller = null;      switch (compiledMethod.getCompilerType()) {      case VM_CompiledMethod.TRAP:      case VM_CompiledMethod.JNI:	if (DEBUG) VM.sysWrite("Skipping sample with TRAP/JNI caller");	continue;      case VM_CompiledMethod.BASELINE:	{	  VM_BaselineCompiledMethod baseCompiledMethod = 	    (VM_BaselineCompiledMethod)compiledMethod;	  // note: the following call expects the offset in INSTRUCTIONS!	  bytecodeIndex = baseCompiledMethod.findBytecodeIndexForInstruction	    (MCOffset>>VM.LG_INSTRUCTION_WIDTH);	  caller = stackFrameCaller;	}	break;      case VM_CompiledMethod.OPT:	{	  VM_OptCompiledMethod optCompiledMethod = (VM_OptCompiledMethod)compiledMethod;	  VM_OptMachineCodeMap mc_map = optCompiledMethod.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.cms.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");  }  