org.jikesrvm.adaptive.controller
Class MultiLevelAdaptiveModel

java.lang.Object
  extended by org.jikesrvm.adaptive.controller.RecompilationStrategy
      extended by org.jikesrvm.adaptive.controller.AnalyticModel
          extended by org.jikesrvm.adaptive.controller.MultiLevelAdaptiveModel

 class MultiLevelAdaptiveModel
extends AnalyticModel

Implements the multi-level adaptive strategy using an analytic model, as described in the OOPSLA 2000 paper. Most behavior inherited from AnalyticModel. This class defines the the specific recompilation choices that should be considered by the analytic model.


Field Summary
protected  RecompileOptChoice[] allOptLevelChoices
          List of all opt-level choices that can be considered by the cost-benefit model
protected  RecompilationChoice[] earlyViableChoices
          Normally, we will be profiling call edges to build a dynamic call graph.
protected  RecompilationChoice[][] viableChoices
          Keep a map from previous compiler to a set of recompilation choices.
 
Constructor Summary
MultiLevelAdaptiveModel()
           
 
Method Summary
protected  void createViableOptionLookupTable(int maxCompiler)
          Setup a lookup table that maps a "previous compiler" to a set of viable recompilation choices.
(package private)  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 populateRecompilationChoices()
          Initialize the set of "optimization choices" that the cost-benefit model will consider.
 
Methods inherited from class org.jikesrvm.adaptive.controller.AnalyticModel
considerHotCallEdge, considerHotMethod, considerOSRRecompilation, futureTimeForMethod, init
 
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
 

Field Detail

allOptLevelChoices

protected RecompileOptChoice[] allOptLevelChoices
List of all opt-level choices that can be considered by the cost-benefit model


viableChoices

protected RecompilationChoice[][] viableChoices
Keep a map from previous compiler to a set of recompilation choices. After initialization, viableChoices[x][y] means that if x is the previous compiler, y makes sense as a possible recompilation choice.


earlyViableChoices

protected RecompilationChoice[] earlyViableChoices
Normally, we will be profiling call edges to build a dynamic call graph. When this is enabled in the system, we want to block the adaptive system from choosing to compile at a level higher than O0 (only does trivial inlining) until the system has built up at least a little knowledge of the call graph. This the cached early-in-the-run viableChoices to be used until the call graph is ready and we can enable all the opt compiler optimization levels.

Constructor Detail

MultiLevelAdaptiveModel

MultiLevelAdaptiveModel()
Method Detail

populateRecompilationChoices

void populateRecompilationChoices()
Initialize the set of "optimization choices" that the cost-benefit model will consider. This method is conceptually simply, but becomes more complex because sets of choices are precomputed and stored in a table so they do not need to be recomputed to answer queries.

Specified by:
populateRecompilationChoices in class AnalyticModel

getViableRecompilationChoices

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

Specified by:
getViableRecompilationChoices in class AnalyticModel
Parameters:
prevCompiler - The compiler compiler that was used to compile cmpMethod
cmpMethod - The compiled method being considered

createViableOptionLookupTable

protected void createViableOptionLookupTable(int maxCompiler)
Setup a lookup table that maps a "previous compiler" to a set of viable recompilation choices. In this case, a viable choice is any compiler > prevCompiler.