org.jikesrvm.adaptive.controller
Class RecompileOptChoice

java.lang.Object
  extended by org.jikesrvm.adaptive.controller.RecompilationChoice
      extended by org.jikesrvm.adaptive.controller.RecompileOptChoice

 class RecompileOptChoice
extends RecompilationChoice

Represents the recompilation choice of simply recompiling the method in question at a particular opt-level. The cost is the expected compilation time at that level, and the benefit is the execution improvement of executing at that level.


Field Summary
private  int thisChoiceCompiler
          The "compiler" (see CompilerDNA) that is associated with this choice
private  int thisChoiceOptLevel
          The opt level associated with this recompilation choice
 
Constructor Summary
RecompileOptChoice(int level)
          Constructor
 
Method Summary
(package private)  int getCompiler()
          Which "compiler" is associated with this choice?
(package private)  double getCost(NormalMethod meth)
          What is the cost of selecting this recompilation choice?
(package private)  double getFutureExecutionTime(int prevCompiler, double futureTimeForMethod)
          What is the benefit of executing this recompilation choice, given the estimated future time for the method if nothing changes?
(package private)  int getOptLevel()
          Which opt-level is associated with this choice?
(package private)  ControllerPlan makeControllerPlan(CompiledMethod cmpMethod, int prevCompiler, double prevTimeForMethod, double bestActionTime, double expectedCompilationTime)
          Return a controller plan that will start this recompilation choice in action.
 String toString()
          How should this choice be displayed?
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

thisChoiceOptLevel

private int thisChoiceOptLevel
The opt level associated with this recompilation choice


thisChoiceCompiler

private int thisChoiceCompiler
The "compiler" (see CompilerDNA) that is associated with this choice

Constructor Detail

RecompileOptChoice

RecompileOptChoice(int level)
Constructor

Parameters:
level - the opt level associated with this choice
Method Detail

getCost

double getCost(NormalMethod meth)
Description copied from class: RecompilationChoice
What is the cost of selecting this recompilation choice?

Specified by:
getCost in class RecompilationChoice
Parameters:
meth - The method being considered for recompilation.
Returns:
The expected cost of executing this recompilation choice

getFutureExecutionTime

double getFutureExecutionTime(int prevCompiler,
                              double futureTimeForMethod)
Description copied from class: RecompilationChoice
What is the benefit of executing this recompilation choice, given the estimated future time for the method if nothing changes?

Specified by:
getFutureExecutionTime in class RecompilationChoice
Parameters:
prevCompiler - The previous compiler
futureTimeForMethod - The expected future execution time of the method if left running with the previous compiler.
Returns:
The expected future execution time if this choice were selected

makeControllerPlan

ControllerPlan makeControllerPlan(CompiledMethod cmpMethod,
                                  int prevCompiler,
                                  double prevTimeForMethod,
                                  double bestActionTime,
                                  double expectedCompilationTime)
Return a controller plan that will start this recompilation choice in action. In this case, simply create a plan to recompile at level thisChoiceOptLevel.

Specified by:
makeControllerPlan in class RecompilationChoice
Parameters:
cmpMethod - The method in question
prevCompiler - The previous compiler
prevTimeForMethod - The estimated future time had nothing been done
bestActionTime - The estimated total time implementing this choice
expectedCompilationTime - The estimated compilation cost implementing this choice
Returns:
The controller plan implementing this recompilation choice

toString

public String toString()
How should this choice be displayed?

Overrides:
toString in class Object

getOptLevel

int getOptLevel()
Which opt-level is associated with this choice?

Returns:
the opt-level for this choice

getCompiler

int getCompiler()
Which "compiler" is associated with this choice?

Returns:
the integer representing the compiler for this choice
See Also:
CompilerDNA.getCompilerConstant(int)