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

com.oracle.truffle.tck.ComplexReadNodeSubNodeGen Maven / Gradle / Ivy

Go to download

A collection of tests that can certify language implementation to be compliant with most recent requirements of the Truffle infrastructure and tooling.

There is a newer version: 1.0.0-rc7
Show newest version
// CheckStyle: start generated
package com.oracle.truffle.tck;

import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.internal.SpecializationNode;
import com.oracle.truffle.api.dsl.internal.SpecializedNode;
import com.oracle.truffle.api.frame.Frame;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;

@GeneratedBy(ComplexReadNodeSub.class)
final class ComplexReadNodeSubNodeGen extends ComplexReadNodeSub implements SpecializedNode {

    @Child private BaseNode_ specialization_;

    private ComplexReadNodeSubNodeGen() {
        this.specialization_ = UninitializedNode_.create(this);
    }

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

    @Override
    public Object executeWithTarget(VirtualFrame frameValue, Object arg0Value, Object arg1Value) {
        return specialization_.execute(frameValue, arg0Value, arg1Value);
    }

    @Override
    public SpecializationNode getSpecializationNode() {
        return specialization_;
    }

    @Override
    public Node deepCopy() {
        return SpecializationNode.updateRoot(super.deepCopy());
    }

    public static ComplexReadNodeSub create() {
        return new ComplexReadNodeSubNodeGen();
    }

    @GeneratedBy(ComplexReadNodeSub.class)
    private abstract static class BaseNode_ extends SpecializationNode {

        @CompilationFinal protected ComplexReadNodeSubNodeGen root;

        BaseNode_(ComplexReadNodeSubNodeGen root, int index) {
            super(index);
            this.root = root;
        }

        @Override
        protected final void setRoot(Node root) {
            this.root = (ComplexReadNodeSubNodeGen) root;
        }

        @Override
        protected final Node[] getSuppliedChildren() {
            return new Node[] {null, null};
        }

        @Override
        public final Object acceptAndExecute(Frame frameValue, Object arg0Value, Object arg1Value) {
            return this.execute((VirtualFrame) frameValue, arg0Value, arg1Value);
        }

        public abstract Object execute(VirtualFrame frameValue, Object arg0Value, Object arg1Value);

        @Override
        protected final SpecializationNode createNext(Frame frameValue, Object arg0Value, Object arg1Value) {
            if (arg0Value instanceof ComplexNumber) {
                if (arg1Value instanceof String) {
                    return AccessWithTarget0Node_.create(root);
                }
                if (arg1Value instanceof Integer) {
                    return AccessWithTarget1Node_.create(root);
                }
            }
            return null;
        }

        protected final BaseNode_ getNext() {
            return (BaseNode_) this.next;
        }

    }
    @GeneratedBy(ComplexReadNodeSub.class)
    private static final class UninitializedNode_ extends BaseNode_ {

        UninitializedNode_(ComplexReadNodeSubNodeGen root) {
            super(root, 2147483647);
        }

        @Override
        public Object execute(VirtualFrame frameValue, Object arg0Value, Object arg1Value) {
            return uninitialized(frameValue, arg0Value, arg1Value);
        }

        static BaseNode_ create(ComplexReadNodeSubNodeGen root) {
            return new UninitializedNode_(root);
        }

    }
    @GeneratedBy(methodName = "accessWithTarget(ComplexNumber, String)", value = ComplexReadNodeSub.class)
    private static final class AccessWithTarget0Node_ extends BaseNode_ {

        AccessWithTarget0Node_(ComplexReadNodeSubNodeGen root) {
            super(root, 1);
        }

        @Override
        public Object execute(VirtualFrame frameValue, Object arg0Value, Object arg1Value) {
            if (arg0Value instanceof ComplexNumber && arg1Value instanceof String) {
                ComplexNumber arg0Value_ = (ComplexNumber) arg0Value;
                String arg1Value_ = (String) arg1Value;
                return root.accessWithTarget(arg0Value_, arg1Value_);
            }
            return getNext().execute(frameValue, arg0Value, arg1Value);
        }

        static BaseNode_ create(ComplexReadNodeSubNodeGen root) {
            return new AccessWithTarget0Node_(root);
        }

    }
    @GeneratedBy(methodName = "accessWithTarget(ComplexNumber, int)", value = ComplexReadNodeSub.class)
    private static final class AccessWithTarget1Node_ extends BaseNode_ {

        AccessWithTarget1Node_(ComplexReadNodeSubNodeGen root) {
            super(root, 2);
        }

        @Override
        public Object execute(VirtualFrame frameValue, Object arg0Value, Object arg1Value) {
            if (arg0Value instanceof ComplexNumber && arg1Value instanceof Integer) {
                ComplexNumber arg0Value_ = (ComplexNumber) arg0Value;
                int arg1Value_ = (int) arg1Value;
                return root.accessWithTarget(arg0Value_, arg1Value_);
            }
            return getNext().execute(frameValue, arg0Value, arg1Value);
        }

        static BaseNode_ create(ComplexReadNodeSubNodeGen root) {
            return new AccessWithTarget1Node_(root);
        }

    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy