use of org.jikesrvm.adaptive.controller.HotMethodEvent in project JikesRVM by JikesRVM.
the class MethodCountData method collectHotMethods.
/**
* Collect the hot methods that have been compiled at the given opt level.
*
* @param optLevel target opt level
* @param threshold hotness value above which the method is considered to
* be hot. (0.0 to 1.0)
* @return a MethodCountSet containing an
* array of compiled methods and an array of their counts.
*/
public synchronized MethodCountSet collectHotMethods(int optLevel, double threshold) {
if (DEBUG)
validityCheck();
ArrayList<HotMethodRecompilationEvent> collect = new ArrayList<HotMethodRecompilationEvent>();
collectHotOptMethodsInternal(1, collect, hotnessToCounts(threshold), optLevel);
// now package the data into the form the caller expects.
int numHotMethods = collect.size();
double[] numCounts = new double[numHotMethods];
CompiledMethod[] hotMethods = new CompiledMethod[numHotMethods];
for (int i = 0; i < numHotMethods; i++) {
HotMethodEvent event = collect.get(i);
hotMethods[i] = event.getCompiledMethod();
numCounts[i] = event.getNumSamples();
}
return new MethodCountSet(hotMethods, numCounts);
}
Aggregations