use of org.graalvm.compiler.truffle.test.nodes.RootTestNode 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 org.graalvm.compiler.truffle.test.nodes.RootTestNode 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 org.graalvm.compiler.truffle.test.nodes.RootTestNode 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 org.graalvm.compiler.truffle.test.nodes.RootTestNode 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));
}
use of org.graalvm.compiler.truffle.test.nodes.RootTestNode in project graal by oracle.
the class SimplePartialEvaluationTest method nestedLoopExplosion.
@Test
public void nestedLoopExplosion() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new AddTestNode(new NestedExplodedLoopTestNode(5), new ConstantTestNode(17));
assertPartialEvalEquals("constant42", new RootTestNode(fd, "nestedLoopExplosion", result));
}
Aggregations