public class OptimizationPlanCompositeElement extends OptimizationPlanElement
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.
Modifier and Type | Field and Description |
---|---|
private OptimizationPlanElement[] |
myElements
Ordered list of elements that together comprise this element.
|
private String |
myName
Name of this element.
|
Constructor and Description |
---|
OptimizationPlanCompositeElement(String n,
Object[] e)
Compose together the argument elements into a composite element
of an optimization plan.
|
OptimizationPlanCompositeElement(String n,
OptimizationPlanElement[] e)
Compose together the argument elements into a composite element
of an optimization plan.
|
Modifier and Type | Method and Description |
---|---|
static OptimizationPlanCompositeElement |
compose(String name,
Object[] elems)
Compose together the argument elements into a composite element
of an optimization plan.
|
double |
elapsedTime()
Report the elapsed time spent in the PlanElement
|
String |
getName() |
void |
initializeForMeasureCompilation()
This method is called to initialize the optimization plan support
measuring compilation.
|
void |
perform(IR ir)
Do the work represented by this element in the optimization plan.
|
boolean |
printingEnabled(OptOptions options,
boolean before)
Returns true if the phase wants the IR dumped before and/or after it runs.
|
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.
|
boolean |
shouldPerform(OptOptions options)
Determine, possibly by consulting the passed options object,
if this optimization plan element should be performed.
|
prettyPrintTime
private final OptimizationPlanElement[] myElements
public OptimizationPlanCompositeElement(String n, OptimizationPlanElement[] e)
n
- The name for this phasee
- The elements to composepublic OptimizationPlanCompositeElement(String n, Object[] e)
n
- The name for this phasee
- The elements to composepublic void initializeForMeasureCompilation()
OptimizationPlanElement
initializeForMeasureCompilation
in class OptimizationPlanElement
public static OptimizationPlanCompositeElement compose(String name, Object[] elems)
name
- The name associated with this composite.elems
- An Object[] of CompilerPhases or
OptimizationPlanElements to be composedpublic boolean shouldPerform(OptOptions options)
OptimizationPlanElement
shouldPerform
in class OptimizationPlanElement
options
- The Options object for the current compilation.true
if the plan element should be performed.public boolean printingEnabled(OptOptions options, boolean before)
options
- the compiler options for the compilationbefore
- true when invoked before perform, false otherwise.true
if the IR should be printed, false
otherwise.public final void perform(IR ir)
OptimizationPlanElement
perform
in class OptimizationPlanElement
ir
- The IR object to work with.public String getName()
getName
in class OptimizationPlanElement
public final void reportStats(int indent, int timeCol, double totalTime)
OptimizationPlanElement
reportStats
in class OptimizationPlanElement
indent
- Number of spaces to indent report.timeCol
- Column number of time portion of report.totalTime
- Total opt compilation time in seconds.public double elapsedTime()
OptimizationPlanElement
elapsedTime
in class OptimizationPlanElement