All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jruby.truffle.extra.TruffleGraalNodesFactory Maven / Gradle / Ivy

The newest version!
// CheckStyle: start generated
package org.jruby.truffle.extra;

import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.NodeFactory;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.NodeCost;
import java.util.Arrays;
import java.util.List;
import org.jruby.truffle.builtins.CoreMethodArrayArgumentsNode;
import org.jruby.truffle.extra.TruffleGraalNodes.AssertConstantNode;
import org.jruby.truffle.extra.TruffleGraalNodes.AssertNotCompiledNode;
import org.jruby.truffle.extra.TruffleGraalNodes.GraalNode;
import org.jruby.truffle.extra.TruffleGraalNodes.GraalVersionNode;
import org.jruby.truffle.extra.TruffleGraalNodes.SubstrateNode;
import org.jruby.truffle.language.RubyNode;

@GeneratedBy(TruffleGraalNodes.class)
public final class TruffleGraalNodesFactory {

    public static List> getFactories() {
        return Arrays.asList(AssertConstantNodeFactory.getInstance(), AssertNotCompiledNodeFactory.getInstance(), GraalNodeFactory.getInstance(), SubstrateNodeFactory.getInstance(), GraalVersionNodeFactory.getInstance());
    }

    @GeneratedBy(AssertConstantNode.class)
    @SuppressWarnings({"unchecked", "rawtypes"})
    public static final class AssertConstantNodeFactory implements NodeFactory {

        private static AssertConstantNodeFactory assertConstantNodeFactoryInstance;

        private AssertConstantNodeFactory() {
        }

        @Override
        public Class getNodeClass() {
            return AssertConstantNode.class;
        }

        @Override
        public List getExecutionSignature() {
            return Arrays.asList(RubyNode.class);
        }

        @Override
        public List getNodeSignatures() {
            return Arrays.asList(Arrays.asList(RubyNode[].class));
        }

        @Override
        public AssertConstantNode createNode(Object... arguments) {
            if (arguments.length == 1 && (arguments[0] == null || arguments[0] instanceof RubyNode[])) {
                return create((RubyNode[]) arguments[0]);
            } else {
                throw new IllegalArgumentException("Invalid create signature.");
            }
        }

        public static NodeFactory getInstance() {
            if (assertConstantNodeFactoryInstance == null) {
                assertConstantNodeFactoryInstance = new AssertConstantNodeFactory();
            }
            return assertConstantNodeFactoryInstance;
        }

        public static AssertConstantNode create(RubyNode[] arguments) {
            return new AssertConstantNodeGen(arguments);
        }

        @GeneratedBy(AssertConstantNode.class)
        public static final class AssertConstantNodeGen extends AssertConstantNode {

            @Child private RubyNode arguments0_;

            private AssertConstantNodeGen(RubyNode[] arguments) {
                this.arguments0_ = arguments != null && 0 < arguments.length ? arguments[0] : null;
            }

            @Override
            public NodeCost getCost() {
                return NodeCost.MONOMORPHIC;
            }

            @Override
            public Object execute(VirtualFrame frameValue) {
                Object arguments0Value_ = arguments0_.execute(frameValue);
                return this.assertConstant(arguments0Value_);
            }

            @Override
            public void executeVoid(VirtualFrame frameValue) {
                execute(frameValue);
                return;
            }

        }
    }
    @GeneratedBy(AssertNotCompiledNode.class)
    @SuppressWarnings({"unchecked", "rawtypes"})
    public static final class AssertNotCompiledNodeFactory implements NodeFactory {

        private static AssertNotCompiledNodeFactory assertNotCompiledNodeFactoryInstance;

        private AssertNotCompiledNodeFactory() {
        }

        @Override
        public Class getNodeClass() {
            return AssertNotCompiledNode.class;
        }

        @Override
        public List getExecutionSignature() {
            return Arrays.asList();
        }

        @Override
        public List getNodeSignatures() {
            return Arrays.asList(Arrays.asList(RubyNode[].class));
        }

        @Override
        public AssertNotCompiledNode createNode(Object... arguments) {
            if (arguments.length == 1 && (arguments[0] == null || arguments[0] instanceof RubyNode[])) {
                return create((RubyNode[]) arguments[0]);
            } else {
                throw new IllegalArgumentException("Invalid create signature.");
            }
        }

        public static NodeFactory getInstance() {
            if (assertNotCompiledNodeFactoryInstance == null) {
                assertNotCompiledNodeFactoryInstance = new AssertNotCompiledNodeFactory();
            }
            return assertNotCompiledNodeFactoryInstance;
        }

        public static AssertNotCompiledNode create(RubyNode[] arguments) {
            return new AssertNotCompiledNodeGen(arguments);
        }

        @GeneratedBy(AssertNotCompiledNode.class)
        public static final class AssertNotCompiledNodeGen extends AssertNotCompiledNode {

            @SuppressWarnings("unused")
            private AssertNotCompiledNodeGen(RubyNode[] arguments) {
            }

            @Override
            public NodeCost getCost() {
                return NodeCost.MONOMORPHIC;
            }

            @Override
            public Object execute(VirtualFrame frameValue) {
                return this.assertNotCompiled();
            }

            @Override
            public void executeVoid(VirtualFrame frameValue) {
                execute(frameValue);
                return;
            }

        }
    }
    @GeneratedBy(GraalNode.class)
    @SuppressWarnings({"unchecked", "rawtypes"})
    public static final class GraalNodeFactory implements NodeFactory {

        private static GraalNodeFactory graalNodeFactoryInstance;

        private GraalNodeFactory() {
        }

        @Override
        public Class getNodeClass() {
            return GraalNode.class;
        }

        @Override
        public List getExecutionSignature() {
            return Arrays.asList();
        }

        @Override
        public List getNodeSignatures() {
            return Arrays.asList(Arrays.asList(RubyNode[].class));
        }

        @Override
        public GraalNode createNode(Object... arguments) {
            if (arguments.length == 1 && (arguments[0] == null || arguments[0] instanceof RubyNode[])) {
                return create((RubyNode[]) arguments[0]);
            } else {
                throw new IllegalArgumentException("Invalid create signature.");
            }
        }

        public static NodeFactory getInstance() {
            if (graalNodeFactoryInstance == null) {
                graalNodeFactoryInstance = new GraalNodeFactory();
            }
            return graalNodeFactoryInstance;
        }

        public static GraalNode create(RubyNode[] arguments) {
            return new GraalNodeGen(arguments);
        }

        @GeneratedBy(GraalNode.class)
        public static final class GraalNodeGen extends GraalNode {

            @SuppressWarnings("unused")
            private GraalNodeGen(RubyNode[] arguments) {
            }

            @Override
            public NodeCost getCost() {
                return NodeCost.MONOMORPHIC;
            }

            @Override
            public Object execute(VirtualFrame frameValue) {
                return executeBoolean(frameValue);
            }

            @Override
            public void executeVoid(VirtualFrame frameValue) {
                executeBoolean(frameValue);
                return;
            }

            @Override
            public boolean executeBoolean(VirtualFrame frameValue) {
                return this.graal();
            }

        }
    }
    @GeneratedBy(SubstrateNode.class)
    @SuppressWarnings({"unchecked", "rawtypes"})
    public static final class SubstrateNodeFactory implements NodeFactory {

        private static SubstrateNodeFactory substrateNodeFactoryInstance;

        private SubstrateNodeFactory() {
        }

        @Override
        public Class getNodeClass() {
            return SubstrateNode.class;
        }

        @Override
        public List getExecutionSignature() {
            return Arrays.asList();
        }

        @Override
        public List getNodeSignatures() {
            return Arrays.asList(Arrays.asList(RubyNode[].class));
        }

        @Override
        public SubstrateNode createNode(Object... arguments) {
            if (arguments.length == 1 && (arguments[0] == null || arguments[0] instanceof RubyNode[])) {
                return create((RubyNode[]) arguments[0]);
            } else {
                throw new IllegalArgumentException("Invalid create signature.");
            }
        }

        public static NodeFactory getInstance() {
            if (substrateNodeFactoryInstance == null) {
                substrateNodeFactoryInstance = new SubstrateNodeFactory();
            }
            return substrateNodeFactoryInstance;
        }

        public static SubstrateNode create(RubyNode[] arguments) {
            return new SubstrateNodeGen(arguments);
        }

        @GeneratedBy(SubstrateNode.class)
        public static final class SubstrateNodeGen extends SubstrateNode {

            @SuppressWarnings("unused")
            private SubstrateNodeGen(RubyNode[] arguments) {
            }

            @Override
            public NodeCost getCost() {
                return NodeCost.MONOMORPHIC;
            }

            @Override
            public Object execute(VirtualFrame frameValue) {
                return executeBoolean(frameValue);
            }

            @Override
            public void executeVoid(VirtualFrame frameValue) {
                executeBoolean(frameValue);
                return;
            }

            @Override
            public boolean executeBoolean(VirtualFrame frameValue) {
                return this.substrate();
            }

        }
    }
    @GeneratedBy(GraalVersionNode.class)
    @SuppressWarnings({"unchecked", "rawtypes"})
    public static final class GraalVersionNodeFactory implements NodeFactory {

        private static GraalVersionNodeFactory graalVersionNodeFactoryInstance;

        private GraalVersionNodeFactory() {
        }

        @Override
        public Class getNodeClass() {
            return GraalVersionNode.class;
        }

        @Override
        public List getExecutionSignature() {
            return Arrays.asList();
        }

        @Override
        public List getNodeSignatures() {
            return Arrays.asList(Arrays.asList(RubyNode[].class));
        }

        @Override
        public GraalVersionNode createNode(Object... arguments) {
            if (arguments.length == 1 && (arguments[0] == null || arguments[0] instanceof RubyNode[])) {
                return create((RubyNode[]) arguments[0]);
            } else {
                throw new IllegalArgumentException("Invalid create signature.");
            }
        }

        public static NodeFactory getInstance() {
            if (graalVersionNodeFactoryInstance == null) {
                graalVersionNodeFactoryInstance = new GraalVersionNodeFactory();
            }
            return graalVersionNodeFactoryInstance;
        }

        public static GraalVersionNode create(RubyNode[] arguments) {
            return new GraalVersionNodeGen(arguments);
        }

        @GeneratedBy(GraalVersionNode.class)
        public static final class GraalVersionNodeGen extends GraalVersionNode {

            @SuppressWarnings("unused")
            private GraalVersionNodeGen(RubyNode[] arguments) {
            }

            @Override
            public NodeCost getCost() {
                return NodeCost.MONOMORPHIC;
            }

            @Override
            public Object execute(VirtualFrame frameValue) {
                return this.graalVersion();
            }

            @Override
            public void executeVoid(VirtualFrame frameValue) {
                execute(frameValue);
                return;
            }

        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy