Search in sources :

Example 1 with StringHashCodeNonFinalNode

use of org.graalvm.compiler.truffle.test.nodes.StringHashCodeNonFinalNode 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));
}
Also used : FrameDescriptor(com.oracle.truffle.api.frame.FrameDescriptor) AbstractTestNode(org.graalvm.compiler.truffle.test.nodes.AbstractTestNode) StringHashCodeNonFinalNode(org.graalvm.compiler.truffle.test.nodes.StringHashCodeNonFinalNode) RootTestNode(org.graalvm.compiler.truffle.test.nodes.RootTestNode) Test(org.junit.Test)

Aggregations

FrameDescriptor (com.oracle.truffle.api.frame.FrameDescriptor)1 AbstractTestNode (org.graalvm.compiler.truffle.test.nodes.AbstractTestNode)1 RootTestNode (org.graalvm.compiler.truffle.test.nodes.RootTestNode)1 StringHashCodeNonFinalNode (org.graalvm.compiler.truffle.test.nodes.StringHashCodeNonFinalNode)1 Test (org.junit.Test)1