Search in sources :

Example 1 with SynchronizedExceptionMergeNode

use of org.graalvm.compiler.truffle.test.nodes.SynchronizedExceptionMergeNode in project graal by oracle.

the class SimplePartialEvaluationTest method synchronizedExceptionMerge.

@Test
public void synchronizedExceptionMerge() {
    /*
         * Multiple non-inlineable methods with exception edges called from a synchronized method
         * lead to a complicated Graal graph that involves the BytecodeFrame.UNWIND_BCI. This test
         * checks that partial evaluation handles that case correctly.
         */
    FrameDescriptor fd = new FrameDescriptor();
    AbstractTestNode result = new SynchronizedExceptionMergeNode();
    RootNode rootNode = new RootTestNode(fd, "synchronizedExceptionMerge", result);
    OptimizedCallTarget compilable = compileHelper("synchronizedExceptionMerge", rootNode, new Object[0]);
    Assert.assertEquals(42, compilable.call(new Object[0]));
}
Also used : FrameDescriptor(com.oracle.truffle.api.frame.FrameDescriptor) RootNode(com.oracle.truffle.api.nodes.RootNode) AbstractTestNode(org.graalvm.compiler.truffle.test.nodes.AbstractTestNode) SynchronizedExceptionMergeNode(org.graalvm.compiler.truffle.test.nodes.SynchronizedExceptionMergeNode) OptimizedCallTarget(org.graalvm.compiler.truffle.runtime.OptimizedCallTarget) RootTestNode(org.graalvm.compiler.truffle.test.nodes.RootTestNode) Test(org.junit.Test)

Aggregations

FrameDescriptor (com.oracle.truffle.api.frame.FrameDescriptor)1 RootNode (com.oracle.truffle.api.nodes.RootNode)1 OptimizedCallTarget (org.graalvm.compiler.truffle.runtime.OptimizedCallTarget)1 AbstractTestNode (org.graalvm.compiler.truffle.test.nodes.AbstractTestNode)1 RootTestNode (org.graalvm.compiler.truffle.test.nodes.RootTestNode)1 SynchronizedExceptionMergeNode (org.graalvm.compiler.truffle.test.nodes.SynchronizedExceptionMergeNode)1 Test (org.junit.Test)1