Search in sources :

Example 1 with BlockNode

use of com.oracle.truffle.api.nodes.BlockNode in project graal by oracle.

the class OptimizedBlockNodeTest method createTest.

private static OptimizedCallTarget createTest(BlockNode<?> block) {
    TestRootNode root = new TestRootNode(block, "Block[" + block.getElements().length + "]");
    OptimizedCallTarget target = (OptimizedCallTarget) root.getCallTarget();
    root.accept(new NodeVisitor() {

        @Override
        public boolean visit(Node node) {
            if (node instanceof TestElement) {
                ((TestElement) node).onAdopt();
            }
            return true;
        }
    });
    return target;
}
Also used : BlockNode(com.oracle.truffle.api.nodes.BlockNode) OptimizedBlockNode(org.graalvm.compiler.truffle.runtime.OptimizedBlockNode) RootNode(com.oracle.truffle.api.nodes.RootNode) Node(com.oracle.truffle.api.nodes.Node) OptimizedCallTarget(org.graalvm.compiler.truffle.runtime.OptimizedCallTarget) NodeVisitor(com.oracle.truffle.api.nodes.NodeVisitor)

Aggregations

BlockNode (com.oracle.truffle.api.nodes.BlockNode)1 Node (com.oracle.truffle.api.nodes.Node)1 NodeVisitor (com.oracle.truffle.api.nodes.NodeVisitor)1 RootNode (com.oracle.truffle.api.nodes.RootNode)1 OptimizedBlockNode (org.graalvm.compiler.truffle.runtime.OptimizedBlockNode)1 OptimizedCallTarget (org.graalvm.compiler.truffle.runtime.OptimizedCallTarget)1