use of org.graalvm.compiler.truffle.test.nodes.ObjectEqualsNode in project graal by oracle.
the class SimplePartialEvaluationTest method intrinsicVirtual.
@Test
public void intrinsicVirtual() {
/*
* The intrinsic for String.equals() is inlined late during Truffle partial evaluation,
* because we call equals() on a value that has the static type Object, but during partial
* evaluation the more precise type String is known.
*/
FrameDescriptor fd = new FrameDescriptor();
AbstractTestNode result = new ObjectEqualsNode("abc", "abf");
RootNode rootNode = new RootTestNode(fd, "intrinsicVirtual", result);
OptimizedCallTarget compilable = compileHelper("intrinsicVirtual", rootNode, new Object[0]);
Assert.assertEquals(42, compilable.call(new Object[0]));
}
Aggregations