use of com.oracle.truffle.api.frame.FrameDescriptor in project graal by oracle.
the class SimplePartialEvaluationTest method longAddConstants.
@Test
public void longAddConstants() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new ConstantTestNode(2);
for (int i = 0; i < 20; ++i) {
result = new AddTestNode(result, new ConstantTestNode(2));
}
assertPartialEvalEquals("constant42", new RootTestNode(fd, "longAddConstants", result));
}
use of com.oracle.truffle.api.frame.FrameDescriptor in project graal by oracle.
the class SimplePartialEvaluationTest method lambda.
@Test
public void lambda() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new LambdaTestNode();
assertPartialEvalEquals("constant42", new RootTestNode(fd, "constantValue", result));
}
use of com.oracle.truffle.api.frame.FrameDescriptor in project graal by oracle.
the class SimplePartialEvaluationTest method tooDeepRecursion.
@Test(expected = BailoutException.class)
public void tooDeepRecursion() {
/* Recursion depth just above the threshold that reports it as too deep recursion. */
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new RecursionTestNode(TruffleCompilerOptions.getValue(PEGraphDecoder.Options.InliningDepthError));
assertPartialEvalEquals("constant42", new RootTestNode(fd, "tooDeepRecursion", result));
}
use of com.oracle.truffle.api.frame.FrameDescriptor in project graal by oracle.
the class SimplePartialEvaluationTest method inliningNullCheck2.
@Test
public void inliningNullCheck2() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new InliningNullCheckNode2();
RootNode rootNode = new RootTestNode(fd, "inliningNullCheck2", result);
OptimizedCallTarget compilable = compileHelper("inliningNullCheck2", rootNode, new Object[0]);
Assert.assertEquals(42, compilable.call(new Object[0]));
}
use of com.oracle.truffle.api.frame.FrameDescriptor in project graal by oracle.
the class SimplePartialEvaluationTest method localVariable.
@Test
public void localVariable() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new BlockTestNode(new AbstractTestNode[] { new StoreLocalTestNode("x", fd, new ConstantTestNode(42)), new LoadLocalTestNode("x", fd) });
assertPartialEvalEquals("constant42", new RootTestNode(fd, "localVariable", result));
}
Aggregations