Search in sources :

Example 1 with HotMethodEvent

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);
}
Also used : HotMethodRecompilationEvent(org.jikesrvm.adaptive.controller.HotMethodRecompilationEvent) HotMethodEvent(org.jikesrvm.adaptive.controller.HotMethodEvent) ArrayList(java.util.ArrayList) CompiledMethod(org.jikesrvm.compilers.common.CompiledMethod) OptCompiledMethod(org.jikesrvm.compilers.opt.runtimesupport.OptCompiledMethod)

Aggregations

ArrayList (java.util.ArrayList)1 HotMethodEvent (org.jikesrvm.adaptive.controller.HotMethodEvent)1 HotMethodRecompilationEvent (org.jikesrvm.adaptive.controller.HotMethodRecompilationEvent)1 CompiledMethod (org.jikesrvm.compilers.common.CompiledMethod)1 OptCompiledMethod (org.jikesrvm.compilers.opt.runtimesupport.OptCompiledMethod)1