org.jikesrvm.adaptive.controller
Class AnalyticModel

java.lang.Object
  extended by org.jikesrvm.adaptive.controller.RecompilationStrategy
      extended by org.jikesrvm.adaptive.controller.AnalyticModel
Direct Known Subclasses:
MultiLevelAdaptiveModel

abstract class AnalyticModel
extends RecompilationStrategy

This class encapsulates the analytic model used by the controller to guide multi-level recompilation decisions. An early version of this model is described in the OOPSLA'2000 paper, but we've made some improvements since then...

See Also:
MultiLevelAdaptiveModel

Constructor Summary
AnalyticModel()
           
 
Method Summary
private  ControllerPlan chooseOSRRecompilation(HotMethodEvent hme)
           
(package private)  void considerHotCallEdge(CompiledMethod cmpMethod, AINewHotEdgeEvent event)
          This function defines how the analytic model handles a AINewHotEdgeEvent.
(package private)  ControllerPlan considerHotMethod(CompiledMethod cmpMethod, HotMethodEvent hme)
          This method is the main decision making loop for all recompilation strategies that use the analytic model.
(package private)  boolean considerOSRRecompilation(CompiledMethod cmpMethod, HotMethodEvent hme, ControllerPlan plan)
           
(package private)  double futureTimeForMethod(HotMethodEvent hme)
          How much time do we expect to spend in the method in the future if we take no recompilation action?
(package private) abstract  RecompilationChoice[] getViableRecompilationChoices(int prevCompiler, CompiledMethod cmpMethod)
          Compute the set of optimization choices that should be considered by the cost-benefit model, given the previous compiler.
(package private)  void init()
          Initialize the analytic model: NOTE: The call to super.init() uses the command line options to set up the optimization plans, so this must be run after the command line options are available.
(package private) abstract  void populateRecompilationChoices()
          Initialize the set of "optimization choices" that the cost-benefit model will consider when using will consider when using adaptive compilation.
 
Methods inherited from class org.jikesrvm.adaptive.controller.RecompilationStrategy
considerForRecompilation, createCompilationPlan, createControllerPlan, createOptimizationPlans, getMaxOptLevel, getPreviousCompiler, previousRecompilationAttempted, processCommandLineOptions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AnalyticModel

AnalyticModel()
Method Detail

populateRecompilationChoices

abstract void populateRecompilationChoices()
Initialize the set of "optimization choices" that the cost-benefit model will consider when using will consider when using adaptive compilation.


getViableRecompilationChoices

abstract RecompilationChoice[] getViableRecompilationChoices(int prevCompiler,
                                                             CompiledMethod cmpMethod)
Compute the set of optimization choices that should be considered by the cost-benefit model, given the previous compiler.

Parameters:
prevCompiler - The compiler compiler that was used to compile cmpMethod
cmpMethod - The compiled method being considered

init

void init()
Initialize the analytic model: NOTE: The call to super.init() uses the command line options to set up the optimization plans, so this must be run after the command line options are available.

Overrides:
init in class RecompilationStrategy

considerHotMethod

ControllerPlan considerHotMethod(CompiledMethod cmpMethod,
                                 HotMethodEvent hme)
This method is the main decision making loop for all recompilation strategies that use the analytic model.

Given a HotMethodRecompilationEvent, this code will determine IF the method should be recompiled, and if so, HOW to perform the recompilation, i.e., what compilation plan should be used. The method returns a controller plan, which contains the compilation plan and other goodies.

Overrides:
considerHotMethod in class RecompilationStrategy
Parameters:
cmpMethod - the compiled method of interest
hme - the HotMethodRecompilationEvent
Returns:
the controller plan to be used or NULL, if no compilation is to be performed.

considerOSRRecompilation

boolean considerOSRRecompilation(CompiledMethod cmpMethod,
                                 HotMethodEvent hme,
                                 ControllerPlan plan)

chooseOSRRecompilation

private ControllerPlan chooseOSRRecompilation(HotMethodEvent hme)
Parameters:
hme - sample data for an outdated cmid
Returns:
a plan representing recompilation with OSR, null if OSR not justified.

considerHotCallEdge

void considerHotCallEdge(CompiledMethod cmpMethod,
                         AINewHotEdgeEvent event)
This function defines how the analytic model handles a AINewHotEdgeEvent. The basic idea is to use the model to evaluate whether it would be better to do nothing or to recompile at the same opt level, assuming there would be some "boost" after performing inlining.

Overrides:
considerHotCallEdge in class RecompilationStrategy

futureTimeForMethod

double futureTimeForMethod(HotMethodEvent hme)
How much time do we expect to spend in the method in the future if we take no recompilation action? The key assumption is that we'll spend just as much time executing in the the method in the future as we have done so far in the past.

Parameters:
hme - The HotMethodEvent in question
Returns:
estimate of future execution time to be spent in this method