use of org.jikesrvm.compilers.opt.OptOptions in project JikesRVM by JikesRVM.
the class OptTestHarnessTest method readingEmptyFilesDoesNotCauseProblems.
@Test
public void readingEmptyFilesDoesNotCauseProblems() throws Exception {
String fileName = "emptyFile";
fileAccess = new TestFileAccess();
fileAccess.putContentForFile(fileName, "");
String[] longCommandLine = { "-longcommandline", fileName };
output = new TestOutput();
OptTestHarness oth = new OptTestHarness(output, new OptOptions(), fileAccess);
oth.mainMethod(longCommandLine);
assertThatNumberOfBaselineCompiledMethodsIs(0);
assertThatNumberOfOptCompiledMethodsIs(0);
assertThatRemainingOutputIsEmptyWhenTrimmed();
assertThatNoAdditionalErrorsHaveOccurred();
}
use of org.jikesrvm.compilers.opt.OptOptions in project JikesRVM by JikesRVM.
the class InvocationCounts method createOptimizationPlan.
/**
* Create the default set of <optimization plan, options> pairs
* Process optimizing compiler command line options.
*/
static void createOptimizationPlan() {
_options = new OptOptions();
int optLevel = Controller.options.INVOCATION_COUNT_OPT_LEVEL;
String[] optCompilerOptions = Controller.getOptCompilerOptions();
_options.setOptLevel(optLevel);
RecompilationStrategy.processCommandLineOptions(_options, optLevel, optLevel, optCompilerOptions);
_optPlan = OptimizationPlanner.createOptimizationPlan(_options);
}
use of org.jikesrvm.compilers.opt.OptOptions in project JikesRVM by JikesRVM.
the class RecompilationStrategy method createOptimizationPlans.
/**
* Creates the default set of <optimization plan, options> pairs.
* Processes optimizing compiler command line options.
*/
void createOptimizationPlans() {
OptOptions options = new OptOptions();
int maxOptLevel = getMaxOptLevel();
_options = new OptOptions[maxOptLevel + 1];
_optPlans = new OptimizationPlanElement[maxOptLevel + 1][];
String[] optCompilerOptions = Controller.getOptCompilerOptions();
for (int i = 0; i <= maxOptLevel; i++) {
_options[i] = options.dup();
// set optimization level specific optimizations
_options[i].setOptLevel(i);
processCommandLineOptions(_options[i], i, maxOptLevel, optCompilerOptions);
_optPlans[i] = OptimizationPlanner.createOptimizationPlan(_options[i]);
}
}
use of org.jikesrvm.compilers.opt.OptOptions in project JikesRVM by JikesRVM.
the class InvokeeThreadLocalContext method init.
/**
* Initialize static members.
*/
public static void init() {
options = new OptOptions();
optimizationPlan = OptimizationPlanner.createOptimizationPlan(options);
// all objects in the specialized method will be thread local
options.ESCAPE_INVOKEE_THREAD_LOCAL = true;
}
use of org.jikesrvm.compilers.opt.OptOptions in project JikesRVM by JikesRVM.
the class GenerationContextTest method prologueAndEpilogueForSynchronizedStaticMethodHaveMonitorEnterAndExit.
@Test
public void prologueAndEpilogueForSynchronizedStaticMethodHaveMonitorEnterAndExit() throws Exception {
NormalMethod nm = getNormalMethodForTest("emptySynchronizedStaticMethod");
CompiledMethod cm = new OptCompiledMethod(-1, nm);
OptOptions opts = new OptOptions();
InlineOracle io = new DefaultInlineOracle();
GenerationContext gc = new GenerationContext(nm, null, cm, opts, io);
InlineSequence inlineSequence = new InlineSequence(nm);
assertThatInlineSequenceWasSetCorrectly(gc, inlineSequence);
assertThatNumberOfParametersIs(gc, 0);
BasicBlock prologue = gc.getPrologue();
assertThatPrologueBlockIsSetupCorrectly(gc, inlineSequence, prologue);
assertThatFirstInstructionInPrologueIsPrologue(inlineSequence, prologue);
Enumeration<Instruction> prologueInstructions = prologue.forwardRealInstrEnumerator();
prologueInstructions.nextElement();
Instruction secondInstruction = prologueInstructions.nextElement();
assertInstructionIsMonitorEnterInPrologue(secondInstruction, inlineSequence);
assertThatGuardIsCorrectForMonitorEnter(secondInstruction);
Operand lockObject = MonitorOp.getRef(secondInstruction);
Operand expectedLockObject = buildLockObjectForStaticMethod(nm);
assertTrue(expectedLockObject.similar(lockObject));
assertThatNumberOfRealInstructionsMatches(prologue, 2);
BasicBlock epilogue = gc.getEpilogue();
assertThatEpilogueBlockIsSetupCorrectly(gc, inlineSequence, epilogue);
assertThatFirstInstructionEpilogueIsMonitorExit(inlineSequence, epilogue);
assertThatLastInstructionInEpilogueIsReturn(gc, epilogue);
assertThatReturnInstructionReturnsVoid(epilogue);
assertThatNumberOfRealInstructionsMatches(epilogue, 2);
assertThatExitBlockIsSetCorrectly(gc);
assertThatRegisterPoolExists(gc);
assertThatDataIsSavedCorrectly(nm, cm, io, gc);
assertThatReturnValueIsVoid(gc);
assertThatExceptionHandlersWereGenerated(gc);
assertThatUnlockAndRethrowBlockIsCorrect(gc, inlineSequence, prologue, expectedLockObject, epilogue);
assertThatChecksWontBeSkipped(gc);
}
Aggregations