for (int i=0; i<hotMethodSet.cmids.length; i++) { int cmid	                   = hotMethodSet.cmids[i]; VM_CompiledMethod hotMethod = VM_CompiledMethods.getCompiledMethod(cmid);
for (int i=0; i<hotMethodSet.cms.length; i++) { VM_CompiledMethod hotMethod = hotMethodSet.cms[i]; int cmid                    = hotMethod.getId();
   private void findMethodsToRecompile(Vector vectorOfTriples,				       VM_MethodCountSet hotMethodSet) {     if (DEBUG) VM.sysWrite("\nVM_AIByEdgeOrganizer.findMethodsToRecompile() "                + hotMethodSet.cmids.length+"\n");     if (vectorOfTriples.isEmpty() || hotMethodSet.cmids.length == 0) {       if (DEBUG) VM.sysWrite("  return early\n");       return;     }     // Consider each hot max opt level method     for (int i=0; i<hotMethodSet.cmids.length; i++) {       int cmid	                   = hotMethodSet.cmids[i];       VM_CompiledMethod hotMethod = VM_CompiledMethods.getCompiledMethod(cmid);       double numSamples           = hotMethodSet.counters[i];       VM_OptMachineCodeMap mcMap  = 	 ((VM_OptCompilerInfo)hotMethod.getCompilerInfo()).getMCMap();       double edgeHotness          = 0.0;       if (DEBUG) VM.sysWrite(" Process hot method: "+			      hotMethod.getMethod()+" with "+numSamples+"\n");       // For each edge, see if the callsite is present,        // but the callee is absent in hotMethod.       for (Enumeration triples = vectorOfTriples.elements();                 triples.hasMoreElements(); ) {	 VM_CallSiteTriple triple = (VM_CallSiteTriple)triples.nextElement();	 if (!VM_AdaptiveInlining.knownNonInlinedEdge(cmid, triple)) {	   VM_Method caller = triple.getCaller();	   int bytecodeIndex= triple.getBytecodeIndex();	   VM_Method callee = triple.getCallee();	   if (DEBUG) VM.sysWrite("   Edge candidate "+triple+"\n");	   try {	     if (mcMap.callsitePresent(caller, bytecodeIndex)) {	       if (DEBUG) VM.sysWrite(" FOUND EDGE: "+triple+				      " that can be inlined into "				      +hotMethod.getMethod()+"\n");	       edgeHotness += triple.getWeight();	       if (VM.LogAOSEvents) 		 VM_AOSLogging.inliningOpportunityDetected(hotMethod, 							   numSamples, 							   triple);	     }	   }	   catch (Throwable e){	     VM.sysWrite("ERROR in adaptive system! Exception caught!\n");	     VM.sysWrite(" AI Organizer considering edge "+triple+			 " to be inlined into "			   +hotMethod.getMethod()+"\n");	     e.printStackTrace();	   }	 }       }       // Notify the controller if we found a candidate edge in hotMethod       if (edgeHotness > 0.0001) {	 edgeHotness   /= VM_AdaptiveInlining.getNumYieldPoints();	 double boost   = 	   1.0 + (VM_Controller.options.MAX_EXPECTED_AI_BOOST * edgeHotness);	 VM_AINewHotEdgeEvent event = 	   new VM_AINewHotEdgeEvent(cmid, numSamples, boost);	 if (!VM_Controller.controllerInputQueue.prioritizedInsert(numSamples, 								   event)) {	   if (VM.LogAOSEvents) VM_AOSLogging.controllerInputQueueFull(event);	 } else {	   if (VM.LogAOSEvents) {	     VM_CompiledMethod cm = VM_CompiledMethods.getCompiledMethod(cmid);	     VM_AOSLogging.controllerNotifiedForInlining(cm, 							 numSamples, 							 boost);	   }	 }       }     }          if (DEBUG)        VM.sysWrite("\nVM_AIByEdgeOrganizer.findMethodsToRecompile() exit\n\n");   }