use of org.graalvm.compiler.truffle.test.nodes.AbstractTestNode in project graal by oracle.
the class ReadOnlyArrayListPartialEvaluationTest method constantValue.
@Test
public void constantValue() {
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new ReadOnlyArrayListConstantNode(42);
assertPartialEvalEquals("constant42", new RootTestNode(fd, "constantValue", result));
}
use of org.graalvm.compiler.truffle.test.nodes.AbstractTestNode 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 org.graalvm.compiler.truffle.test.nodes.AbstractTestNode 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.AbstractTestNode 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.AbstractTestNode 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]));
}
Aggregations