public abstract class OptimizationPlanElement extends Object
NOTE: Instances of subclasses of this class are held in OptimizationPlanner.masterPlan and thus represent global state. It is therefore incorrect for any per-compilation state to be stored in an instance field of one of these objects.
TODO: refactor the optimization plan elements and compiler phases
| Constructor and Description |
|---|
OptimizationPlanElement() |
| Modifier and Type | Method and Description |
|---|---|
abstract double |
elapsedTime()
Report the elapsed time spent in the PlanElement
|
abstract String |
getName() |
abstract void |
initializeForMeasureCompilation()
This method is called to initialize the optimization plan support
measuring compilation.
|
abstract void |
perform(IR ir)
Do the work represented by this element in the optimization plan.
|
protected void |
prettyPrintTime(double time,
double totalTime)
Helper function for
reportStats |
abstract void |
reportStats(int indent,
int timeCol,
double totalTime)
Generate (to the sysWrite stream) a report of the
time spent performing this element of the optimization plan.
|
abstract boolean |
shouldPerform(OptOptions options)
Determine, possibly by consulting the passed options object,
if this optimization plan element should be performed.
|
public OptimizationPlanElement()
public abstract boolean shouldPerform(OptOptions options)
options - The Options object for the current compilation.true if the plan element should be performed.public abstract void perform(IR ir)
ir - The IR object to work with.public abstract void initializeForMeasureCompilation()
public abstract void reportStats(int indent, int timeCol, double totalTime)
indent - Number of spaces to indent report.timeCol - Column number of time portion of report.totalTime - Total opt compilation time in seconds.public abstract double elapsedTime()
protected void prettyPrintTime(double time, double totalTime)
reportStats time - time spent for executing an elementtotalTime - total time spent on executing all the elements