use of com.oracle.truffle.api.frame.FrameDescriptor in project graal by oracle.
the class BailoutPartialEvaluationTest method partialEvaluationConstantBailout1.
@Test(expected = BailoutException.class)
public void partialEvaluationConstantBailout1() {
FrameDescriptor fd = new FrameDescriptor();
RootTestNode rootNode = new RootTestNode(fd, "partialEvaluationConstantBailout1", new AbstractTestNode() {
@Override
public int execute(VirtualFrame frame) {
CompilerAsserts.partialEvaluationConstant(notConstant);
return 0;
}
});
compileHelper("partialEvaluationConstantBailout1", rootNode, new Object[] {});
}
use of com.oracle.truffle.api.frame.FrameDescriptor in project graal by oracle.
the class BytecodeInterpreterPartialEvaluationTest method instArraySimpleIfProgram.
@Test
public void instArraySimpleIfProgram() {
FrameDescriptor fd = new FrameDescriptor();
FrameSlot valueSlot = fd.addFrameSlot("value", FrameSlotKind.Int);
FrameSlot returnSlot = fd.addFrameSlot("return", FrameSlotKind.Int);
Inst[] inst = new Inst[] { /* 0: */
new Inst.Const(valueSlot, 1, 1), /* 1: */
new Inst.IfZero(valueSlot, 2, 4), /* 2: */
new Inst.Const(returnSlot, 41, 3), /* 3: */
new Inst.Return(), /* 4: */
new Inst.Const(returnSlot, 42, 5), /* 5: */
new Inst.Return() };
assertPartialEvalEqualsAndRunsCorrect(new InstArrayProgram("instArraySimpleIfProgram", inst, returnSlot, fd));
}
use of com.oracle.truffle.api.frame.FrameDescriptor in project graal by oracle.
the class CastExactPartialEvaluationTest method testCommon.
private void testCommon(AbstractTestNode testNode, String testName) {
FrameDescriptor fd = new FrameDescriptor();
RootNode rootNode = new RootTestNode(fd, testName, testNode);
RootCallTarget callTarget = Truffle.getRuntime().createCallTarget(rootNode);
Assert.assertEquals(42, callTarget.call(newBuffer()));
assertPartialEvalNoInvokes(callTarget, new Object[] { newBuffer() });
}
use of com.oracle.truffle.api.frame.FrameDescriptor in project graal by oracle.
the class CompilationFinalPartialEvaluationTest method compilationFinalTest1.
@Test
public void compilationFinalTest1() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new CompilationFinalTestNode();
assertPartialEvalEquals("constant42", new RootTestNode(fd, "compilationFinalTest", result));
}
use of com.oracle.truffle.api.frame.FrameDescriptor in project graal by oracle.
the class CompilerAssertsTest method compilationConstantTest.
@Test
public void compilationConstantTest() {
FrameDescriptor descriptor = new FrameDescriptor();
CompilationConstantTestNode result = new CompilationConstantTestNode(new ConstantTestNode(5));
RootTestNode rootNode = new RootTestNode(descriptor, "compilationConstant", result);
compileHelper("compilationConstant", rootNode, new Object[0]);
}
Aggregations