use of org.graalvm.compiler.truffle.test.nodes.AbstractTestNode in project graal by oracle.
the class CastExactPartialEvaluationTest method castExactCompilerDirective.
/**
* Tests the effect of {@link CompilerDirectives#castExact} on method devirtualization.
*/
@Test
public void castExactCompilerDirective() {
AbstractTestNode result = new CastExactTestNode(newBuffer().getClass());
testCommon(result, "castExactCompilerDirective");
}
use of org.graalvm.compiler.truffle.test.nodes.AbstractTestNode 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 org.graalvm.compiler.truffle.test.nodes.AbstractTestNode in project graal by oracle.
the class ControlFlowExceptionPartialEvaluationTest method catchControlFlowExceptionFromCall.
@Test
public void catchControlFlowExceptionFromCall() {
Assume.assumeTrue(TruffleCompilerOptions.getValue(TruffleFunctionInlining));
CallTarget callTarget = Truffle.getRuntime().createCallTarget(new RootTestNode(new FrameDescriptor(), "throwControlFlowException", new ThrowControlFlowExceptionTestNode()));
AbstractTestNode result = new CatchControlFlowExceptionTestNode(new CallTestNode(callTarget));
assertPartialEvalEquals("constant42", new RootTestNode(new FrameDescriptor(), "catchControlFlowExceptionFromCall", result));
}
use of org.graalvm.compiler.truffle.test.nodes.AbstractTestNode in project graal by oracle.
the class SimplePartialEvaluationTest method longSequenceConstants.
@Test
public void longSequenceConstants() {
FrameDescriptor fd = new FrameDescriptor();
int length = 40;
AbstractTestNode[] children = new AbstractTestNode[length];
for (int i = 0; i < children.length; ++i) {
children[i] = new ConstantTestNode(42);
}
AbstractTestNode result = new BlockTestNode(children);
assertPartialEvalEquals("constant42", new RootTestNode(fd, "longSequenceConstants", result));
}
use of org.graalvm.compiler.truffle.test.nodes.AbstractTestNode in project graal by oracle.
the class SimplePartialEvaluationTest method intrinsicStringHashCodeNonFinal.
@Test
public void intrinsicStringHashCodeNonFinal() {
/*
* The intrinsic for String.hashcode() does not trigger on non-constant strings, so the
* method String.hashCode() must be inlined during partial evaluation (so there must not be
* an invoke after partial evaluation).
*/
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new StringHashCodeNonFinalNode("*");
assertPartialEvalNoInvokes(new RootTestNode(fd, "intrinsicStringHashCodeNonFinal", result));
}
Aggregations