Search in sources :

Example 86 with NormalMethod

use of org.jikesrvm.classloader.NormalMethod in project JikesRVM by JikesRVM.

the class GenerationContextTest method unintBeginAndUnintEndAreNotAddedWhenDirectParentHasThem.

@Test
public void unintBeginAndUnintEndAreNotAddedWhenDirectParentHasThem() throws Exception {
    NormalMethod nm = getNormalMethodForTest("emptyStaticUninterruptibleMethod");
    CompiledMethod cm = new OptCompiledMethod(-1, nm);
    OptOptions opts = new OptOptions();
    InlineOracle io = new DefaultInlineOracle();
    GenerationContext gc = new GenerationContext(nm, null, cm, opts, io);
    assertThatStateIsCorrectForUnsynchronizedEmptyStaticMethod(nm, cm, io, gc);
    NormalMethod interruptibleCallee = getNormalMethodForTest("emptyStaticUninterruptibleMethod");
    Instruction callInstr = buildCallInstructionForStaticMethodWithoutReturn(interruptibleCallee, nm);
    ExceptionHandlerBasicBlockBag ebag = getMockEbag();
    GenerationContext child = gc.createChildContext(ebag, interruptibleCallee, callInstr);
    Enumeration<Instruction> prologueRealInstr = child.getPrologue().forwardRealInstrEnumerator();
    assertThatNoMoreInstructionsExist(prologueRealInstr);
    Enumeration<Instruction> epilogueRealInstr = child.getEpilogue().forwardRealInstrEnumerator();
    assertThatNoMoreInstructionsExist(epilogueRealInstr);
}
Also used : OptCompiledMethod(org.jikesrvm.compilers.opt.runtimesupport.OptCompiledMethod) DefaultInlineOracle(org.jikesrvm.compilers.opt.inlining.DefaultInlineOracle) InlineOracle(org.jikesrvm.compilers.opt.inlining.InlineOracle) NormalMethod(org.jikesrvm.classloader.NormalMethod) DefaultInlineOracle(org.jikesrvm.compilers.opt.inlining.DefaultInlineOracle) OptOptions(org.jikesrvm.compilers.opt.OptOptions) Instruction(org.jikesrvm.compilers.opt.ir.Instruction) OptCompiledMethod(org.jikesrvm.compilers.opt.runtimesupport.OptCompiledMethod) CompiledMethod(org.jikesrvm.compilers.common.CompiledMethod) ExceptionHandlerBasicBlockBag(org.jikesrvm.compilers.opt.ir.ExceptionHandlerBasicBlockBag) Test(org.junit.Test)

Example 87 with NormalMethod

use of org.jikesrvm.classloader.NormalMethod in project JikesRVM by JikesRVM.

the class InlineSequenceTest method testGetRootMethod.

@Test
public void testGetRootMethod() throws Exception {
    InlineSequence s0 = createInlineSequence(Methods.class, "root");
    InlineSequence s1 = createInlineSequence(s0, 0, Methods.class, "m");
    InlineSequence s2 = createInlineSequence(s1, 2, Methods.class, "n");
    NormalMethod methodroot = getNormalMethod(Methods.class, "root");
    assertEquals(methodroot, s2.getRootMethod());
}
Also used : NormalMethod(org.jikesrvm.classloader.NormalMethod) Test(org.junit.Test)

Example 88 with NormalMethod

use of org.jikesrvm.classloader.NormalMethod in project JikesRVM by JikesRVM.

the class InlineSequenceTest method testGetMethod.

@Test
public void testGetMethod() throws Exception {
    InlineSequence s0 = createInlineSequence(Methods.class, "root");
    InlineSequence s1 = createInlineSequence(s0, 0, Methods.class, "m");
    InlineSequence s2 = createInlineSequence(s1, 2, Methods.class, "n");
    NormalMethod root = getNormalMethod(Methods.class, "root");
    NormalMethod a = getNormalMethod(Methods.class, "m");
    NormalMethod b = getNormalMethod(Methods.class, "n");
    assertEquals(root, s0.getMethod());
    assertEquals(a, s1.getMethod());
    assertEquals(b, s2.getMethod());
}
Also used : NormalMethod(org.jikesrvm.classloader.NormalMethod) Test(org.junit.Test)

Example 89 with NormalMethod

use of org.jikesrvm.classloader.NormalMethod 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 90 with NormalMethod

use of org.jikesrvm.classloader.NormalMethod 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)

Aggregations

NormalMethod (org.jikesrvm.classloader.NormalMethod)95 Test (org.junit.Test)66 OptOptions (org.jikesrvm.compilers.opt.OptOptions)45 CompiledMethod (org.jikesrvm.compilers.common.CompiledMethod)41 OptCompiledMethod (org.jikesrvm.compilers.opt.runtimesupport.OptCompiledMethod)31 DefaultInlineOracle (org.jikesrvm.compilers.opt.inlining.DefaultInlineOracle)28 InlineOracle (org.jikesrvm.compilers.opt.inlining.InlineOracle)28 RegisterOperand (org.jikesrvm.compilers.opt.ir.operand.RegisterOperand)28 Instruction (org.jikesrvm.compilers.opt.ir.Instruction)21 InlineSequence (org.jikesrvm.compilers.opt.inlining.InlineSequence)17 TypeReference (org.jikesrvm.classloader.TypeReference)15 ExceptionHandlerBasicBlockBag (org.jikesrvm.compilers.opt.ir.ExceptionHandlerBasicBlockBag)15 MethodOperand (org.jikesrvm.compilers.opt.ir.operand.MethodOperand)15 BasicBlock (org.jikesrvm.compilers.opt.ir.BasicBlock)13 ExceptionHandlerBasicBlock (org.jikesrvm.compilers.opt.ir.ExceptionHandlerBasicBlock)13 Register (org.jikesrvm.compilers.opt.ir.Register)13 RVMMethod (org.jikesrvm.classloader.RVMMethod)8 Operand (org.jikesrvm.compilers.opt.ir.operand.Operand)8 TrueGuardOperand (org.jikesrvm.compilers.opt.ir.operand.TrueGuardOperand)8 TypeOperand (org.jikesrvm.compilers.opt.ir.operand.TypeOperand)8