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

org.jruby.truffle.language.constants.LookupConstantWithDynamicScopeNodeGen Maven / Gradle / Ivy

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

import com.oracle.truffle.api.Assumption;
import com.oracle.truffle.api.CompilerDirectives;
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.dsl.internal.SuppressFBWarnings;
import com.oracle.truffle.api.frame.Frame;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.InvalidAssumptionException;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
import com.oracle.truffle.api.profiles.ConditionProfile;
import org.jruby.truffle.language.LexicalScope;
import org.jruby.truffle.language.RubyConstant;

@GeneratedBy(LookupConstantWithDynamicScopeNode.class)
@SuppressFBWarnings("SA_LOCAL_SELF_COMPARISON")
public final class LookupConstantWithDynamicScopeNodeGen extends LookupConstantWithDynamicScopeNode implements SpecializedNode {

    @Child private BaseNode_ specialization_;

    private LookupConstantWithDynamicScopeNodeGen(String name) {
        super(name);
        this.specialization_ = UninitializedNode_.create(this);
    }

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

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

    @Override
    public RubyConstant executeLookupConstant(VirtualFrame frameValue) {
        return specialization_.executeRubyConstant(frameValue);
    }

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

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

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

    public static LookupConstantWithDynamicScopeNode create(String name) {
        return new LookupConstantWithDynamicScopeNodeGen(name);
    }

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

        @CompilationFinal protected LookupConstantWithDynamicScopeNodeGen root;

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

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

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

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

        public abstract Object execute(VirtualFrame frameValue);

        public RubyConstant executeRubyConstant(VirtualFrame frameValue) {
            return (RubyConstant) execute(frameValue);
        }

        public void executeVoid(VirtualFrame frameValue) {
            executeRubyConstant(frameValue);
            return;
        }

        @Override
        protected final SpecializationNode createNext(Frame frameValue) {
            LexicalScope lexicalScope1 = (root.getLexicalScope((VirtualFrame) frameValue));
            if ((root.getLexicalScope((VirtualFrame) frameValue) == lexicalScope1)) {
                CompilerDirectives.transferToInterpreterAndInvalidate();
                RubyConstant constant1 = (root.doLookup(lexicalScope1));
                boolean isVisible1 = (root.isVisible(lexicalScope1, constant1));
                Assumption assumption0_1 = (root.getUnmodifiedAssumption(lexicalScope1.getLiveModule()));
                if (isValid(assumption0_1)) {
                    SpecializationNode s = LookupConstantNode_.create(root, lexicalScope1, constant1, isVisible1, assumption0_1);
                    if (countSame(s) < (root.getCacheLimit())) {
                        return s;
                    }
                }
            }
            CompilerDirectives.transferToInterpreterAndInvalidate();
            ConditionProfile isVisibleProfile2 = (ConditionProfile.createBinaryProfile());
            ConditionProfile isDeprecatedProfile2 = (ConditionProfile.createBinaryProfile());
            return LookupConstantUncachedNode_.create(root, isVisibleProfile2, isDeprecatedProfile2);
        }

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

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

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

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

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

    }
    @GeneratedBy(methodName = "lookupConstant(VirtualFrame, LexicalScope, RubyConstant, boolean)", value = LookupConstantWithDynamicScopeNode.class)
    private static final class LookupConstantNode_ extends BaseNode_ {

        private final LexicalScope lexicalScope;
        private final RubyConstant constant;
        private final boolean isVisible;
        @CompilationFinal private final Assumption assumption0_;

        LookupConstantNode_(LookupConstantWithDynamicScopeNodeGen root, LexicalScope lexicalScope, RubyConstant constant, boolean isVisible, Assumption assumption0_) {
            super(root, 1);
            this.lexicalScope = lexicalScope;
            this.constant = constant;
            this.isVisible = isVisible;
            this.assumption0_ = assumption0_;
        }

        @Override
        public boolean isIdentical(SpecializationNode other, Frame frameValue) {
            if ((root.getLexicalScope((VirtualFrame) frameValue) == this.lexicalScope)) {
                return true;
            }
            return false;
        }

        @Override
        public Object execute(VirtualFrame frameValue) {
            try {
                check(this.assumption0_);
            } catch (InvalidAssumptionException ae) {
                return removeThis("Assumption [assumption0] invalidated", frameValue);
            }
            if ((root.getLexicalScope(frameValue) == this.lexicalScope)) {
                return root.lookupConstant(frameValue, this.lexicalScope, this.constant, this.isVisible);
            }
            return getNext().execute(frameValue);
        }

        static BaseNode_ create(LookupConstantWithDynamicScopeNodeGen root, LexicalScope lexicalScope, RubyConstant constant, boolean isVisible, Assumption assumption0_) {
            return new LookupConstantNode_(root, lexicalScope, constant, isVisible, assumption0_);
        }

    }
    @GeneratedBy(methodName = "lookupConstantUncached(VirtualFrame, ConditionProfile, ConditionProfile)", value = LookupConstantWithDynamicScopeNode.class)
    private static final class LookupConstantUncachedNode_ extends BaseNode_ {

        private final ConditionProfile isVisibleProfile;
        private final ConditionProfile isDeprecatedProfile;

        LookupConstantUncachedNode_(LookupConstantWithDynamicScopeNodeGen root, ConditionProfile isVisibleProfile, ConditionProfile isDeprecatedProfile) {
            super(root, 2);
            this.isVisibleProfile = isVisibleProfile;
            this.isDeprecatedProfile = isDeprecatedProfile;
        }

        @Override
        public Object execute(VirtualFrame frameValue) {
            return root.lookupConstantUncached(frameValue, this.isVisibleProfile, this.isDeprecatedProfile);
        }

        static BaseNode_ create(LookupConstantWithDynamicScopeNodeGen root, ConditionProfile isVisibleProfile, ConditionProfile isDeprecatedProfile) {
            return new LookupConstantUncachedNode_(root, isVisibleProfile, isDeprecatedProfile);
        }

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy