Search in sources :

Example 66 with OptOptions

use of org.jikesrvm.compilers.opt.OptOptions 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;
}
Also used : IR(org.jikesrvm.compilers.opt.ir.IR) OptOptions(org.jikesrvm.compilers.opt.OptOptions)

Example 67 with OptOptions

use of org.jikesrvm.compilers.opt.OptOptions in project JikesRVM by JikesRVM.

the class ActiveSetTest method createActiveSetFromRegisterAllocatorState.

private ActiveSet createActiveSetFromRegisterAllocatorState(RegisterAllocatorState state) throws Exception {
    NormalMethod nm = TestingTools.getNormalMethod(MethodsForTests.class, "emptyStaticMethodWithoutAnnotations");
    OptOptions opts = new OptOptions();
    IR ir = new IR(nm, null, opts);
    ir.MIRInfo = new MIRInfo(ir);
    ir.MIRInfo.regAllocState = state;
    SpillLocationManager spillLocManager = new SpillLocationManager(ir);
    this.spillLocations = spillLocManager;
    return new ActiveSet(ir, spillLocManager, null);
}
Also used : MIRInfo(org.jikesrvm.compilers.opt.ir.MIRInfo) NormalMethod(org.jikesrvm.classloader.NormalMethod) IR(org.jikesrvm.compilers.opt.ir.IR) OptOptions(org.jikesrvm.compilers.opt.OptOptions)

Example 68 with OptOptions

use of org.jikesrvm.compilers.opt.OptOptions in project JikesRVM by JikesRVM.

the class ActiveSetTest method findAvailableRegisterIgnoresInfrequentIntervalsWhenDesired.

@Test
public void findAvailableRegisterIgnoresInfrequentIntervalsWhenDesired() throws Exception {
    NormalMethod nm = TestingTools.getNormalMethod(MethodsForTests.class, "emptyStaticMethodWithoutAnnotations");
    OptOptions opts = new OptOptions();
    opts.FREQ_FOCUS_EFFORT = true;
    IR ir = new IR(nm, null, opts);
    ir.MIRInfo = new MIRInfo(ir);
    SpillLocationManager spillLocManager = new SpillLocationManager(ir);
    this.spillLocations = spillLocManager;
    ActiveSet active = new ActiveSet(ir, spillLocManager, null);
    CompoundInterval infrequentCode = new CompoundInterval(null);
    assertNull(active.findAvailableRegister(infrequentCode));
}
Also used : MIRInfo(org.jikesrvm.compilers.opt.ir.MIRInfo) NormalMethod(org.jikesrvm.classloader.NormalMethod) IR(org.jikesrvm.compilers.opt.ir.IR) OptOptions(org.jikesrvm.compilers.opt.OptOptions) Test(org.junit.Test)

Example 69 with OptOptions

use of org.jikesrvm.compilers.opt.OptOptions in project JikesRVM by JikesRVM.

the class OptTestHarnessTest method usesSameOptionsAsBootimageCompilerWhenRequested.

// Note: this test will break when the bootimage options change
@Test
@Category(RequiresOptCompiler.class)
public void usesSameOptionsAsBootimageCompilerWhenRequested() throws Exception {
    String[] useBootimageCompilerOptions = { "-useBootOptions" };
    output = new TestOutput();
    OptOptions optOptions = new OptOptions();
    optOptions.INLINE_GUARDED = !optOptions.guardWithCodePatch();
    OptTestHarness oth = new OptTestHarness(output, optOptions, new TestFileAccess());
    oth.mainMethod(useBootimageCompilerOptions);
    assertThatNoAdditionalErrorsHaveOccurred();
    assertThat(oth.options.INLINE_GUARDED, is(optOptions.guardWithCodePatch()));
}
Also used : OptOptions(org.jikesrvm.compilers.opt.OptOptions) Category(org.junit.experimental.categories.Category) Test(org.junit.Test)

Example 70 with OptOptions

use of org.jikesrvm.compilers.opt.OptOptions in project JikesRVM by JikesRVM.

the class OptTestHarnessTest method executeOTHWithStreamRedirection.

private void executeOTHWithStreamRedirection(String[] othArguments) throws InvocationTargetException, IllegalAccessException {
    try {
        output = new TestOutput();
        fileAccess = new TestFileAccess();
        redirectStandardStreams();
        OptTestHarness oth = new OptTestHarness(output, new OptOptions(), fileAccess);
        oth.mainMethod(othArguments);
    } finally {
        resetStandardStreams();
    }
}
Also used : OptOptions(org.jikesrvm.compilers.opt.OptOptions)

Aggregations

OptOptions (org.jikesrvm.compilers.opt.OptOptions)70 Test (org.junit.Test)48 NormalMethod (org.jikesrvm.classloader.NormalMethod)45 CompiledMethod (org.jikesrvm.compilers.common.CompiledMethod)32 OptCompiledMethod (org.jikesrvm.compilers.opt.runtimesupport.OptCompiledMethod)29 DefaultInlineOracle (org.jikesrvm.compilers.opt.inlining.DefaultInlineOracle)28 InlineOracle (org.jikesrvm.compilers.opt.inlining.InlineOracle)28 RegisterOperand (org.jikesrvm.compilers.opt.ir.operand.RegisterOperand)27 Instruction (org.jikesrvm.compilers.opt.ir.Instruction)19 InlineSequence (org.jikesrvm.compilers.opt.inlining.InlineSequence)17 ExceptionHandlerBasicBlockBag (org.jikesrvm.compilers.opt.ir.ExceptionHandlerBasicBlockBag)14 MethodOperand (org.jikesrvm.compilers.opt.ir.operand.MethodOperand)13 TypeReference (org.jikesrvm.classloader.TypeReference)12 BasicBlock (org.jikesrvm.compilers.opt.ir.BasicBlock)12 ExceptionHandlerBasicBlock (org.jikesrvm.compilers.opt.ir.ExceptionHandlerBasicBlock)12 Register (org.jikesrvm.compilers.opt.ir.Register)12 Operand (org.jikesrvm.compilers.opt.ir.operand.Operand)8 TrueGuardOperand (org.jikesrvm.compilers.opt.ir.operand.TrueGuardOperand)8 ClassConstantOperand (org.jikesrvm.compilers.opt.ir.operand.ClassConstantOperand)7 ObjectConstantOperand (org.jikesrvm.compilers.opt.ir.operand.ObjectConstantOperand)7