use of org.jikesrvm.compilers.opt.OptOptions in project JikesRVM by JikesRVM.
the class GenerationContextTest method threadLocalSynchronizedStaticMethodDoesNotHaveMonitorEnterAndMonitorExit.
@Test
public void threadLocalSynchronizedStaticMethodDoesNotHaveMonitorEnterAndMonitorExit() throws Exception {
NormalMethod nm = getNormalMethodForTest("emptySynchronizedStaticMethod");
CompiledMethod cm = new OptCompiledMethod(-1, nm);
OptOptions opts = new OptOptions();
opts.ESCAPE_INVOKEE_THREAD_LOCAL = true;
InlineOracle io = new DefaultInlineOracle();
GenerationContext gc = new GenerationContext(nm, null, cm, opts, io);
assertThatStateIsCorrectForUnsynchronizedEmptyStaticMethod(nm, cm, io, gc);
}
use of org.jikesrvm.compilers.opt.OptOptions in project JikesRVM by JikesRVM.
the class GenerationContextTest method methodIsSelectedForDebuggingWithMethodToPrintReturnsTrueIfMethodOfContextMatches.
@Test
public void methodIsSelectedForDebuggingWithMethodToPrintReturnsTrueIfMethodOfContextMatches() throws Exception {
String methodName = "emptyStaticMethodWithoutAnnotations";
NormalMethod nm = getNormalMethodForTest(methodName);
CompiledMethod cm = new OptCompiledMethod(-1, nm);
OptOptions opts = buildOptionsWithMethodToPrintOptionSet(methodName);
InlineOracle io = new DefaultInlineOracle();
GenerationContext gc = new GenerationContext(nm, null, cm, opts, io);
assertThat(gc.methodIsSelectedForDebuggingWithMethodToPrint(), is(true));
}
use of org.jikesrvm.compilers.opt.OptOptions in project JikesRVM by JikesRVM.
the class GenerationContextTest method transferStateUpdatesFieldsInParentFromChild.
@Test
public void transferStateUpdatesFieldsInParentFromChild() throws Exception {
NormalMethod nm = getNormalMethodForTest("emptyStaticMethodWithoutAnnotations");
CompiledMethod cm = new OptCompiledMethod(-1, nm);
OptOptions opts = new OptOptions();
InlineOracle io = new DefaultInlineOracle();
GenerationContext parent = new GenerationContext(nm, null, cm, opts, io);
int targetNumberOfNodes = 23456789;
assertThatContextIsInExpectedState(parent, targetNumberOfNodes);
NormalMethod interruptibleCallee = getNormalMethodForTest("emptyStaticMethodWithoutAnnotations");
Instruction callInstr = buildCallInstructionForStaticMethodWithoutReturn(interruptibleCallee, nm);
ExceptionHandlerBasicBlockBag ebag = getMockEbag();
GenerationContext child = parent.createChildContext(ebag, interruptibleCallee, callInstr);
setTransferableProperties(targetNumberOfNodes, child);
child.transferStateToParent();
assertThatStateWasTransferedToOtherContext(parent, targetNumberOfNodes);
}
use of org.jikesrvm.compilers.opt.OptOptions in project JikesRVM by JikesRVM.
the class GenerationContextTest method rethrowBlockIsCorrectForSynchronizedMethodInlinedIntoSynchronizedMethod.
@Test
public void rethrowBlockIsCorrectForSynchronizedMethodInlinedIntoSynchronizedMethod() 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);
NormalMethod callee = getNormalMethodForTest("emptySynchronizedStaticMethod");
Instruction callInstr = buildCallInstructionForStaticMethodWithoutReturn(callee, nm);
ExceptionHandlerBasicBlockBag ebag = gc.getEnclosingHandlers();
GenerationContext childContext = gc.createChildContext(ebag, callee, callInstr);
assertThatExceptionHandlersWereGenerated(childContext);
Operand expectedLockObject = buildLockObjectForStaticMethod(callee);
assertThatUnlockAndRethrowBlockIsCorrectForInlinedMethod(gc, childContext, childContext.getInlineSequence(), childContext.getPrologue(), expectedLockObject, childContext.getEpilogue());
assertThatChecksWontBeSkipped(gc);
}
use of org.jikesrvm.compilers.opt.OptOptions in project JikesRVM by JikesRVM.
the class GenerationContextTest method buildOptionsWithMethodToPrintOptionSet.
private OptOptions buildOptionsWithMethodToPrintOptionSet(String methodName) {
OptOptions opts = new OptOptions();
opts.processAsOption("-X:opt:", "method_to_print=" + methodName);
assertThat(opts.hasMETHOD_TO_PRINT(), is(true));
Iterator<String> iterator = opts.getMETHOD_TO_PRINTs();
String methodNameFromOpts = iterator.next();
assertThat(methodNameFromOpts, is(methodName));
return opts;
}
Aggregations