public abstract class RecompilationStrategy extends Object
Modifier and Type | Field and Description |
---|---|
private OptOptions[] |
_options |
private OptimizationPlanElement[][] |
_optPlans |
Constructor and Description |
---|
RecompilationStrategy() |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
considerForRecompilation(HotMethodEvent hme,
ControllerPlan plan)
Should we consider the hme for recompilation?
|
(package private) void |
considerHotCallEdge(CompiledMethod cmpMethod,
AINewHotEdgeEvent event) |
(package private) ControllerPlan |
considerHotMethod(CompiledMethod cmpMethod,
HotMethodEvent hme) |
CompilationPlan |
createCompilationPlan(NormalMethod method,
int optLevel,
InstrumentationPlan instPlan)
Constructs a compilation plan that will compile the given method
with instrumentation.
|
(package private) ControllerPlan |
createControllerPlan(RVMMethod method,
int optLevel,
InstrumentationPlan instPlan,
int prevCMID,
double expectedSpeedup,
double expectedCompilationTime,
double priority)
This helper method creates a ControllerPlan, which contains a
CompilationPlan, for the passed method using the passed optimization
level and instrumentation plan.
|
(package private) void |
createOptimizationPlans()
Creates the default set of <optimization plan, options> pairs.
|
(package private) int |
getMaxOptLevel() |
(package private) int |
getPreviousCompiler(CompiledMethod cmpMethod) |
(package private) void |
init()
Initialize the recompilation strategy.
|
(package private) boolean |
previousRecompilationAttempted(RVMMethod method)
This method returns
true if we've already tried to recompile the
passed method. |
static void |
processCommandLineOptions(OptOptions options,
int optLevel,
int maxOptLevel,
String[] optCompilerOptions)
Process the command line arguments and pass the appropriate ones to the
Options
Called by sampling and counters recompilation strategy.
|
private void |
transferSamplesToNewPlan(HotMethodEvent hme) |
private OptimizationPlanElement[][] _optPlans
private OptOptions[] _options
public RecompilationStrategy()
ControllerPlan considerHotMethod(CompiledMethod cmpMethod, HotMethodEvent hme)
void considerHotCallEdge(CompiledMethod cmpMethod, AINewHotEdgeEvent event)
void init()
Note: This uses the command line options to set up the optimization plans, so this must be run after the command line options are available.
ControllerPlan createControllerPlan(RVMMethod method, int optLevel, InstrumentationPlan instPlan, int prevCMID, double expectedSpeedup, double expectedCompilationTime, double priority)
method
- the RVMMethod for the planoptLevel
- the optimization level to use in the planinstPlan
- the instrumentation plan to useprevCMID
- the previous compiled method IDexpectedSpeedup
- expected speedup from this recompilationexpectedCompilationTime
- expected time for compilation
and execution of the new methodpriority
- a measure of the oveall benefit we expect to see
by executing this plan.public CompilationPlan createCompilationPlan(NormalMethod method, int optLevel, InstrumentationPlan instPlan)
method
- The method to be compiled with instrumentationoptLevel
- The opt-level to recompile atinstPlan
- The instrumentation plannull
compilation planboolean considerForRecompilation(HotMethodEvent hme, ControllerPlan plan)
hme
- the HotMethodEventplan
- the ControllerPlan for the compiled method (may be null
)true/false
valueprivate void transferSamplesToNewPlan(HotMethodEvent hme)
boolean previousRecompilationAttempted(RVMMethod method)
true
if we've already tried to recompile the
passed method. It does not guarantee that the compilation was
successful.method
- the method of interestint getPreviousCompiler(CompiledMethod cmpMethod)
cmpMethod
- the compiled method whose previous compiler we want to knowint getMaxOptLevel()
void createOptimizationPlans()
public static void processCommandLineOptions(OptOptions options, int optLevel, int maxOptLevel, String[] optCompilerOptions)
options
- The options being constructedoptLevel
- The level of the options being constructedmaxOptLevel
- The maximum valid opt leveloptCompilerOptions
- The list of command line options