use of org.jikesrvm.compilers.opt.ir.IR in project JikesRVM by JikesRVM.
the class CompilationPlan method execute.
/**
* Execute a compilation plan by executing each element
* in the optimization plan.
*
* @return the IR created by the execution of the optimization plan
*/
public IR execute() {
IR ir = new IR(method, this);
// If there is instrumentation to perform, do some initialization
if (instrumentationPlan != null) {
instrumentationPlan.initInstrumentation(method);
}
for (OptimizationPlanElement element : optimizationPlan) {
ir.setIdForNextPhase();
element.perform(ir);
}
// whether this matters.
if (instrumentationPlan != null) {
instrumentationPlan.finalizeInstrumentation(method);
}
return ir;
}
use of org.jikesrvm.compilers.opt.ir.IR in project JikesRVM by JikesRVM.
the class TailRecursionEliminationTest method doesNotThrowExceptionsOnCFGWithoutInstructions.
@Test
public void doesNotThrowExceptionsOnCFGWithoutInstructions() {
OptOptions opts = new OptOptions();
IR ir = new IR(null, null, opts);
opts.setOptLevel(1);
TestingTools.addEmptyCFGToIR(ir);
tailRecursionElimination.perform(ir);
}
use of org.jikesrvm.compilers.opt.ir.IR in project JikesRVM by JikesRVM.
the class SplitBasicBlockTest method doesNotSplitEmptyCFG.
@Test
public void doesNotSplitEmptyCFG() {
int maxInstPerBlock = 1;
IR ir = createIRWithEmptyCFG(maxInstPerBlock);
int nodeNumberBefore = ir.cfg.numberOfNodes();
splitPhase.perform(ir);
int nodeNumberAfter = ir.cfg.numberOfNodes();
assertThat(nodeNumberAfter, is(nodeNumberBefore));
}
use of org.jikesrvm.compilers.opt.ir.IR in project JikesRVM by JikesRVM.
the class SplitBasicBlockTest method splitsAllBlocksThatHaveTooManyInstructions.
@Test
public void splitsAllBlocksThatHaveTooManyInstructions() {
int maxInstPerBlock = 2;
IR ir = createIRWithEmptyCFG(maxInstPerBlock);
addNumberOfInstructionsToBlock(ir, 13);
splitPhase.perform(ir);
assertThatInstructionCountForEachBlockIsAtMost(ir, maxInstPerBlock);
}
use of org.jikesrvm.compilers.opt.ir.IR in project JikesRVM by JikesRVM.
the class SplitBasicBlockTest method createIRWithEmptyCFG.
private IR createIRWithEmptyCFG(int maxInstPerBlock) {
OptOptions opts = new OptOptions();
IR ir = new IR(null, null, opts);
opts.L2M_MAX_BLOCK_SIZE = maxInstPerBlock;
TestingTools.addEmptyCFGToIR(ir);
return ir;
}
Aggregations