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

com.oracle.truffle.sl.nodes.local.VariablesObjectGen Maven / Gradle / Ivy

There is a newer version: 24.1.1
Show newest version
// CheckStyle: start generated
package com.oracle.truffle.sl.nodes.local;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.TruffleLanguage;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.frame.FrameSlot;
import com.oracle.truffle.api.interop.InteropLibrary;
import com.oracle.truffle.api.interop.UnknownIdentifierException;
import com.oracle.truffle.api.interop.UnsupportedMessageException;
import com.oracle.truffle.api.interop.UnsupportedTypeException;
import com.oracle.truffle.api.library.DynamicDispatchLibrary;
import com.oracle.truffle.api.library.LibraryExport;
import com.oracle.truffle.api.library.LibraryFactory;
import com.oracle.truffle.api.nodes.ExplodeLoop;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.nodes.NodeCost;
import com.oracle.truffle.api.source.SourceSection;
import com.oracle.truffle.sl.nodes.controlflow.SLBlockNode;
import com.oracle.truffle.sl.nodes.local.SLScopedNode.VariablesObject;
import com.oracle.truffle.sl.nodes.local.SLScopedNode.VariablesObject.ExistsMember;
import com.oracle.truffle.sl.nodes.local.SLScopedNode.VariablesObject.ModifiableMember;
import com.oracle.truffle.sl.nodes.local.SLScopedNode.VariablesObject.ReadMember;
import com.oracle.truffle.sl.nodes.local.SLScopedNode.VariablesObject.WriteMember;
import java.util.concurrent.locks.Lock;

@GeneratedBy(VariablesObject.class)
final class VariablesObjectGen {

    private static final LibraryFactory DYNAMIC_DISPATCH_LIBRARY_ = LibraryFactory.resolve(DynamicDispatchLibrary.class);

    static  {
        LibraryExport.register(VariablesObject.class, new InteropLibraryExports());
    }

    private VariablesObjectGen() {
    }

    @GeneratedBy(VariablesObject.class)
    private static final class InteropLibraryExports extends LibraryExport {

        private InteropLibraryExports() {
            super(InteropLibrary.class, VariablesObject.class, false);
        }

        @Override
        protected InteropLibrary createUncached(Object receiver) {
            assert receiver instanceof VariablesObject;
            InteropLibrary uncached = new Uncached();
            return uncached;
        }

        @Override
        protected InteropLibrary createCached(Object receiver) {
            assert receiver instanceof VariablesObject;
            return new Cached(receiver);
        }

        @GeneratedBy(VariablesObject.class)
        private static final class Cached extends InteropLibrary {

            @CompilationFinal private volatile int state_;
            @CompilationFinal private volatile int exclude_;
            @CompilationFinal private SLBlockNode block;
            @CompilationFinal private Node parentBlock;
            @CompilationFinal private ExistsMemberCachedData existsMember_cached_cache;
            @CompilationFinal private ModifiableMemberCachedData modifiableMember_cached_cache;
            @CompilationFinal private ReadMemberCachedData readMember_cached_cache;
            @Child private WriteMemberCachedData writeMember_cached_cache;
            @CompilationFinal private SLScopedNode acceptsNode__cachedNode_;
            @CompilationFinal private boolean acceptsNode__cachedNodeEnter_;
            @Child private GetMembersNode_GetMembersData getMembersNode__getMembers_cache;

            Cached(Object originalReceiver) {
                VariablesObject receiver = ((VariablesObject) originalReceiver) ;
                this.acceptsNode__cachedNode_ = (receiver.node);
                this.acceptsNode__cachedNodeEnter_ = (receiver.nodeEnter);
            }

            @Override
            public boolean accepts(Object receiver) {
                assert !(receiver instanceof VariablesObject) || DYNAMIC_DISPATCH_LIBRARY_.getUncached().dispatch(receiver) == null : "Invalid library export. Exported receiver with dynamic dispatch found but not expected.";
                return receiver instanceof VariablesObject && accepts_(receiver);
            }

            @ExplodeLoop
            @Override
            public boolean isMemberReadable(Object arg0Value_, String arg1Value) {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                assert assertAdopted();
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                int state = state_;
                if ((state & 0b11) != 0 /* is-active doCached(VariablesObject, String, String, boolean) || doGeneric(VariablesObject, String) */) {
                    if ((state & 0b1) != 0 /* is-active doCached(VariablesObject, String, String, boolean) */) {
                        ExistsMemberCachedData s1_ = this.existsMember_cached_cache;
                        while (s1_ != null) {
                            if ((s1_.cachedMember_.equals(arg1Value))) {
                                return ExistsMember.doCached(arg0Value, arg1Value, s1_.cachedMember_, s1_.cachedResult_);
                            }
                            s1_ = s1_.next_;
                        }
                    }
                    if ((state & 0b10) != 0 /* is-active doGeneric(VariablesObject, String) */) {
                        return ExistsMember.doGeneric(arg0Value, arg1Value);
                    }
                }
                CompilerDirectives.transferToInterpreterAndInvalidate();
                return existsMemberAndSpecialize(arg0Value, arg1Value);
            }

            private boolean existsMemberAndSpecialize(VariablesObject arg0Value, String arg1Value) {
                Lock lock = getLock();
                boolean hasLock = true;
                lock.lock();
                int state = state_;
                int exclude = exclude_;
                try {
                    if (((exclude & 0b1)) == 0 /* is-not-excluded doCached(VariablesObject, String, String, boolean) */) {
                        int count1_ = 0;
                        ExistsMemberCachedData s1_ = this.existsMember_cached_cache;
                        if ((state & 0b1) != 0 /* is-active doCached(VariablesObject, String, String, boolean) */) {
                            while (s1_ != null) {
                                if ((s1_.cachedMember_.equals(arg1Value))) {
                                    break;
                                }
                                s1_ = s1_.next_;
                                count1_++;
                            }
                        }
                        if (s1_ == null) {
                            // assert (s1_.cachedMember_.equals(arg1Value));
                            if (count1_ < (VariablesObject.LIMIT)) {
                                s1_ = new ExistsMemberCachedData(existsMember_cached_cache);
                                s1_.cachedMember_ = (arg1Value);
                                s1_.cachedResult_ = (ExistsMember.doGeneric(arg0Value, arg1Value));
                                this.existsMember_cached_cache = s1_;
                                this.state_ = state = state | 0b1 /* add-active doCached(VariablesObject, String, String, boolean) */;
                            }
                        }
                        if (s1_ != null) {
                            lock.unlock();
                            hasLock = false;
                            return ExistsMember.doCached(arg0Value, arg1Value, s1_.cachedMember_, s1_.cachedResult_);
                        }
                    }
                    this.exclude_ = exclude = exclude | 0b1 /* add-excluded doCached(VariablesObject, String, String, boolean) */;
                    this.existsMember_cached_cache = null;
                    state = state & 0xfffffffe /* remove-active doCached(VariablesObject, String, String, boolean) */;
                    this.state_ = state = state | 0b10 /* add-active doGeneric(VariablesObject, String) */;
                    lock.unlock();
                    hasLock = false;
                    return ExistsMember.doGeneric(arg0Value, arg1Value);
                } finally {
                    if (hasLock) {
                        lock.unlock();
                    }
                }
            }

            @Override
            public NodeCost getCost() {
                int state = state_;
                if ((state & 0b11) == 0b0) {
                    return NodeCost.UNINITIALIZED;
                } else if (((state & 0b11) & ((state & 0b11) - 1)) == 0 /* is-single-active  */) {
                    ExistsMemberCachedData s1_ = this.existsMember_cached_cache;
                    if ((s1_ == null || s1_.next_ == null)) {
                        return NodeCost.MONOMORPHIC;
                    }
                }
                return NodeCost.POLYMORPHIC;
            }

            @ExplodeLoop
            @Override
            public boolean isMemberModifiable(Object arg0Value_, String arg1Value) {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                assert assertAdopted();
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                int state = state_;
                if ((state & 0b1100) != 0 /* is-active doCached(VariablesObject, String, String, boolean) || doGeneric(VariablesObject, String) */) {
                    if ((state & 0b100) != 0 /* is-active doCached(VariablesObject, String, String, boolean) */) {
                        ModifiableMemberCachedData s1_ = this.modifiableMember_cached_cache;
                        while (s1_ != null) {
                            if ((s1_.cachedMember_.equals(arg1Value))) {
                                return ModifiableMember.doCached(arg0Value, arg1Value, s1_.cachedMember_, s1_.cachedResult_);
                            }
                            s1_ = s1_.next_;
                        }
                    }
                    if ((state & 0b1000) != 0 /* is-active doGeneric(VariablesObject, String) */) {
                        return ModifiableMember.doGeneric(arg0Value, arg1Value);
                    }
                }
                CompilerDirectives.transferToInterpreterAndInvalidate();
                return modifiableMemberAndSpecialize(arg0Value, arg1Value);
            }

            private boolean modifiableMemberAndSpecialize(VariablesObject arg0Value, String arg1Value) {
                Lock lock = getLock();
                boolean hasLock = true;
                lock.lock();
                int state = state_;
                int exclude = exclude_;
                try {
                    if (((exclude & 0b10)) == 0 /* is-not-excluded doCached(VariablesObject, String, String, boolean) */) {
                        int count1_ = 0;
                        ModifiableMemberCachedData s1_ = this.modifiableMember_cached_cache;
                        if ((state & 0b100) != 0 /* is-active doCached(VariablesObject, String, String, boolean) */) {
                            while (s1_ != null) {
                                if ((s1_.cachedMember_.equals(arg1Value))) {
                                    break;
                                }
                                s1_ = s1_.next_;
                                count1_++;
                            }
                        }
                        if (s1_ == null) {
                            // assert (s1_.cachedMember_.equals(arg1Value));
                            if (count1_ < (VariablesObject.LIMIT)) {
                                s1_ = new ModifiableMemberCachedData(modifiableMember_cached_cache);
                                s1_.cachedMember_ = (arg1Value);
                                s1_.cachedResult_ = (arg0Value.hasWriteNode(arg1Value));
                                this.modifiableMember_cached_cache = s1_;
                                this.state_ = state = state | 0b100 /* add-active doCached(VariablesObject, String, String, boolean) */;
                            }
                        }
                        if (s1_ != null) {
                            lock.unlock();
                            hasLock = false;
                            return ModifiableMember.doCached(arg0Value, arg1Value, s1_.cachedMember_, s1_.cachedResult_);
                        }
                    }
                    this.exclude_ = exclude = exclude | 0b10 /* add-excluded doCached(VariablesObject, String, String, boolean) */;
                    this.modifiableMember_cached_cache = null;
                    state = state & 0xfffffffb /* remove-active doCached(VariablesObject, String, String, boolean) */;
                    this.state_ = state = state | 0b1000 /* add-active doGeneric(VariablesObject, String) */;
                    lock.unlock();
                    hasLock = false;
                    return ModifiableMember.doGeneric(arg0Value, arg1Value);
                } finally {
                    if (hasLock) {
                        lock.unlock();
                    }
                }
            }

            @ExplodeLoop
            @Override
            public Object readMember(Object arg0Value_, String arg1Value) throws UnsupportedMessageException, UnknownIdentifierException {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                assert assertAdopted();
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                int state = state_;
                if ((state & 0b110000) != 0 /* is-active doCached(VariablesObject, String, String, FrameSlot) || doGeneric(VariablesObject, String) */) {
                    if ((state & 0b10000) != 0 /* is-active doCached(VariablesObject, String, String, FrameSlot) */) {
                        ReadMemberCachedData s1_ = this.readMember_cached_cache;
                        while (s1_ != null) {
                            if ((s1_.cachedMember_.equals(arg1Value))) {
                                return ReadMember.doCached(arg0Value, arg1Value, s1_.cachedMember_, s1_.slot_);
                            }
                            s1_ = s1_.next_;
                        }
                    }
                    if ((state & 0b100000) != 0 /* is-active doGeneric(VariablesObject, String) */) {
                        return ReadMember.doGeneric(arg0Value, arg1Value);
                    }
                }
                CompilerDirectives.transferToInterpreterAndInvalidate();
                return readMemberAndSpecialize(arg0Value, arg1Value);
            }

            private Object readMemberAndSpecialize(VariablesObject arg0Value, String arg1Value) throws UnknownIdentifierException {
                Lock lock = getLock();
                boolean hasLock = true;
                lock.lock();
                int state = state_;
                int exclude = exclude_;
                try {
                    if (((exclude & 0b100)) == 0 /* is-not-excluded doCached(VariablesObject, String, String, FrameSlot) */) {
                        int count1_ = 0;
                        ReadMemberCachedData s1_ = this.readMember_cached_cache;
                        if ((state & 0b10000) != 0 /* is-active doCached(VariablesObject, String, String, FrameSlot) */) {
                            while (s1_ != null) {
                                if ((s1_.cachedMember_.equals(arg1Value))) {
                                    break;
                                }
                                s1_ = s1_.next_;
                                count1_++;
                            }
                        }
                        if (s1_ == null) {
                            // assert (s1_.cachedMember_.equals(arg1Value));
                            if (count1_ < (VariablesObject.LIMIT)) {
                                s1_ = new ReadMemberCachedData(readMember_cached_cache);
                                s1_.cachedMember_ = (arg1Value);
                                s1_.slot_ = (arg0Value.findSlot(arg1Value));
                                this.readMember_cached_cache = s1_;
                                this.state_ = state = state | 0b10000 /* add-active doCached(VariablesObject, String, String, FrameSlot) */;
                            }
                        }
                        if (s1_ != null) {
                            lock.unlock();
                            hasLock = false;
                            return ReadMember.doCached(arg0Value, arg1Value, s1_.cachedMember_, s1_.slot_);
                        }
                    }
                    this.exclude_ = exclude = exclude | 0b100 /* add-excluded doCached(VariablesObject, String, String, FrameSlot) */;
                    this.readMember_cached_cache = null;
                    state = state & 0xffffffef /* remove-active doCached(VariablesObject, String, String, FrameSlot) */;
                    this.state_ = state = state | 0b100000 /* add-active doGeneric(VariablesObject, String) */;
                    lock.unlock();
                    hasLock = false;
                    return ReadMember.doGeneric(arg0Value, arg1Value);
                } finally {
                    if (hasLock) {
                        lock.unlock();
                    }
                }
            }

            @ExplodeLoop
            @Override
            public void writeMember(Object arg0Value_, String arg1Value, Object arg2Value) throws UnsupportedMessageException, UnknownIdentifierException, UnsupportedTypeException {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                assert assertAdopted();
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                int state = state_;
                if ((state & 0b11000000) != 0 /* is-active doCached(VariablesObject, String, Object, String, SLWriteLocalVariableNode) || doGeneric(VariablesObject, String, Object) */) {
                    if ((state & 0b1000000) != 0 /* is-active doCached(VariablesObject, String, Object, String, SLWriteLocalVariableNode) */) {
                        WriteMemberCachedData s1_ = this.writeMember_cached_cache;
                        while (s1_ != null) {
                            if ((s1_.cachedMember_.equals(arg1Value))) {
                                WriteMember.doCached(arg0Value, arg1Value, arg2Value, s1_.cachedMember_, s1_.writeNode_);
                                return;
                            }
                            s1_ = s1_.next_;
                        }
                    }
                    if ((state & 0b10000000) != 0 /* is-active doGeneric(VariablesObject, String, Object) */) {
                        WriteMember.doGeneric(arg0Value, arg1Value, arg2Value);
                        return;
                    }
                }
                CompilerDirectives.transferToInterpreterAndInvalidate();
                writeMemberAndSpecialize(arg0Value, arg1Value, arg2Value);
                return;
            }

            private void writeMemberAndSpecialize(VariablesObject arg0Value, String arg1Value, Object arg2Value) throws UnknownIdentifierException, UnsupportedMessageException {
                Lock lock = getLock();
                boolean hasLock = true;
                lock.lock();
                int state = state_;
                int exclude = exclude_;
                try {
                    if (((exclude & 0b1000)) == 0 /* is-not-excluded doCached(VariablesObject, String, Object, String, SLWriteLocalVariableNode) */) {
                        int count1_ = 0;
                        WriteMemberCachedData s1_ = this.writeMember_cached_cache;
                        if ((state & 0b1000000) != 0 /* is-active doCached(VariablesObject, String, Object, String, SLWriteLocalVariableNode) */) {
                            while (s1_ != null) {
                                if ((s1_.cachedMember_.equals(arg1Value))) {
                                    break;
                                }
                                s1_ = s1_.next_;
                                count1_++;
                            }
                        }
                        if (s1_ == null) {
                            // assert (s1_.cachedMember_.equals(arg1Value));
                            if (count1_ < (VariablesObject.LIMIT)) {
                                s1_ = super.insert(new WriteMemberCachedData(writeMember_cached_cache));
                                s1_.cachedMember_ = (arg1Value);
                                s1_.writeNode_ = (arg0Value.findWriteNode(arg1Value));
                                this.writeMember_cached_cache = s1_;
                                this.state_ = state = state | 0b1000000 /* add-active doCached(VariablesObject, String, Object, String, SLWriteLocalVariableNode) */;
                            }
                        }
                        if (s1_ != null) {
                            lock.unlock();
                            hasLock = false;
                            WriteMember.doCached(arg0Value, arg1Value, arg2Value, s1_.cachedMember_, s1_.writeNode_);
                            return;
                        }
                    }
                    this.exclude_ = exclude = exclude | 0b1000 /* add-excluded doCached(VariablesObject, String, Object, String, SLWriteLocalVariableNode) */;
                    this.writeMember_cached_cache = null;
                    state = state & 0xffffffbf /* remove-active doCached(VariablesObject, String, Object, String, SLWriteLocalVariableNode) */;
                    this.state_ = state = state | 0b10000000 /* add-active doGeneric(VariablesObject, String, Object) */;
                    lock.unlock();
                    hasLock = false;
                    WriteMember.doGeneric(arg0Value, arg1Value, arg2Value);
                    return;
                } finally {
                    if (hasLock) {
                        lock.unlock();
                    }
                }
            }

            private boolean accepts_(Object arg0Value_) {
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                return arg0Value.accepts(this.acceptsNode__cachedNode_, this.acceptsNode__cachedNodeEnter_);
            }

            @Override
            public boolean isScope(Object receiver) {
                assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
                assert assertAdopted();
                return (((VariablesObject) receiver)).isScope();
            }

            @Override
            public boolean hasLanguage(Object receiver) {
                assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
                assert assertAdopted();
                return (((VariablesObject) receiver)).hasLanguage();
            }

            @Override
            public Class> getLanguage(Object receiver) throws UnsupportedMessageException {
                assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
                assert assertAdopted();
                return (((VariablesObject) receiver)).getLanguage();
            }

            @Override
            public Object toDisplayString(Object arg0Value_, boolean arg1Value) {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                assert assertAdopted();
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                int state = state_;
                if ((state & 0b100000000) != 0 /* is-active toDisplayString(VariablesObject, boolean, SLBlockNode, Node) */) {
                    return arg0Value.toDisplayString(arg1Value, this.block, this.parentBlock);
                }
                CompilerDirectives.transferToInterpreterAndInvalidate();
                return toDisplayStringNode_AndSpecialize(arg0Value, arg1Value);
            }

            private Object toDisplayStringNode_AndSpecialize(VariablesObject arg0Value, boolean arg1Value) {
                Lock lock = getLock();
                boolean hasLock = true;
                lock.lock();
                int state = state_;
                try {
                    if (this.block == null) {
                        this.block = (arg0Value.block);
                    }
                    if (this.parentBlock == null) {
                        this.parentBlock = (arg0Value.block.findBlock());
                    }
                    this.state_ = state = state | 0b100000000 /* add-active toDisplayString(VariablesObject, boolean, SLBlockNode, Node) */;
                    lock.unlock();
                    hasLock = false;
                    return arg0Value.toDisplayString(arg1Value, this.block, this.parentBlock);
                } finally {
                    if (hasLock) {
                        lock.unlock();
                    }
                }
            }

            @Override
            public boolean hasScopeParent(Object arg0Value_) {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                assert assertAdopted();
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                int state = state_;
                if ((state & 0b1000000000) != 0 /* is-active hasScopeParent(VariablesObject, SLBlockNode, Node) */) {
                    return arg0Value.hasScopeParent(this.block, this.parentBlock);
                }
                CompilerDirectives.transferToInterpreterAndInvalidate();
                return hasScopeParentNode_AndSpecialize(arg0Value);
            }

            private boolean hasScopeParentNode_AndSpecialize(VariablesObject arg0Value) {
                Lock lock = getLock();
                boolean hasLock = true;
                lock.lock();
                int state = state_;
                try {
                    if (this.block == null) {
                        this.block = (arg0Value.block);
                    }
                    if (this.parentBlock == null) {
                        this.parentBlock = (arg0Value.block.findBlock());
                    }
                    this.state_ = state = state | 0b1000000000 /* add-active hasScopeParent(VariablesObject, SLBlockNode, Node) */;
                    lock.unlock();
                    hasLock = false;
                    return arg0Value.hasScopeParent(this.block, this.parentBlock);
                } finally {
                    if (hasLock) {
                        lock.unlock();
                    }
                }
            }

            @Override
            public Object getScopeParent(Object arg0Value_) throws UnsupportedMessageException {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                assert assertAdopted();
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                int state = state_;
                if ((state & 0b10000000000) != 0 /* is-active getScopeParent(VariablesObject, SLBlockNode, Node) */) {
                    return arg0Value.getScopeParent(this.block, this.parentBlock);
                }
                CompilerDirectives.transferToInterpreterAndInvalidate();
                return getScopeParentNode_AndSpecialize(arg0Value);
            }

            private Object getScopeParentNode_AndSpecialize(VariablesObject arg0Value) throws UnsupportedMessageException {
                Lock lock = getLock();
                boolean hasLock = true;
                lock.lock();
                int state = state_;
                try {
                    if (this.block == null) {
                        this.block = (arg0Value.block);
                    }
                    if (this.parentBlock == null) {
                        this.parentBlock = (arg0Value.block.findBlock());
                    }
                    this.state_ = state = state | 0b10000000000 /* add-active getScopeParent(VariablesObject, SLBlockNode, Node) */;
                    lock.unlock();
                    hasLock = false;
                    return arg0Value.getScopeParent(this.block, this.parentBlock);
                } finally {
                    if (hasLock) {
                        lock.unlock();
                    }
                }
            }

            @Override
            public boolean hasSourceLocation(Object receiver) {
                assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
                assert assertAdopted();
                return (((VariablesObject) receiver)).hasSourceLocation();
            }

            @Override
            public SourceSection getSourceLocation(Object receiver) throws UnsupportedMessageException {
                assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
                assert assertAdopted();
                return (((VariablesObject) receiver)).getSourceLocation();
            }

            @Override
            public boolean hasMembers(Object receiver) {
                assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
                assert assertAdopted();
                return (((VariablesObject) receiver)).hasMembers();
            }

            @Override
            public boolean isMemberInsertable(Object receiver, String member) {
                assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
                assert assertAdopted();
                return (((VariablesObject) receiver)).isMemberInsertable(member);
            }

            @Override
            public Object getMembers(Object arg0Value_, boolean arg1Value) throws UnsupportedMessageException {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                assert assertAdopted();
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                int state = state_;
                if ((state & 0b100000000000) != 0 /* is-active getMembers(VariablesObject, boolean, SLWriteLocalVariableNode[], int, int) */) {
                    GetMembersNode_GetMembersData s1_ = this.getMembersNode__getMembers_cache;
                    if (s1_ != null) {
                        return arg0Value.getMembers(arg1Value, s1_.writeNodes_, s1_.visibleVariablesIndex_, s1_.parentBlockIndex_);
                    }
                }
                CompilerDirectives.transferToInterpreterAndInvalidate();
                return getMembersNode_AndSpecialize(arg0Value, arg1Value);
            }

            private Object getMembersNode_AndSpecialize(VariablesObject arg0Value, boolean arg1Value) {
                Lock lock = getLock();
                boolean hasLock = true;
                lock.lock();
                int state = state_;
                try {
                    GetMembersNode_GetMembersData s1_ = super.insert(new GetMembersNode_GetMembersData());
                    s1_.writeNodes_ = (arg0Value.block.getDeclaredLocalVariables());
                    s1_.visibleVariablesIndex_ = (arg0Value.getVisibleVariablesIndex());
                    s1_.parentBlockIndex_ = (arg0Value.block.getParentBlockIndex());
                    this.getMembersNode__getMembers_cache = s1_;
                    this.state_ = state = state | 0b100000000000 /* add-active getMembers(VariablesObject, boolean, SLWriteLocalVariableNode[], int, int) */;
                    lock.unlock();
                    hasLock = false;
                    return arg0Value.getMembers(arg1Value, s1_.writeNodes_, s1_.visibleVariablesIndex_, s1_.parentBlockIndex_);
                } finally {
                    if (hasLock) {
                        lock.unlock();
                    }
                }
            }

            @GeneratedBy(VariablesObject.class)
            private static final class ExistsMemberCachedData {

                @CompilationFinal ExistsMemberCachedData next_;
                @CompilationFinal String cachedMember_;
                @CompilationFinal boolean cachedResult_;

                ExistsMemberCachedData(ExistsMemberCachedData next_) {
                    this.next_ = next_;
                }

            }
            @GeneratedBy(VariablesObject.class)
            private static final class ModifiableMemberCachedData {

                @CompilationFinal ModifiableMemberCachedData next_;
                @CompilationFinal String cachedMember_;
                @CompilationFinal boolean cachedResult_;

                ModifiableMemberCachedData(ModifiableMemberCachedData next_) {
                    this.next_ = next_;
                }

            }
            @GeneratedBy(VariablesObject.class)
            private static final class ReadMemberCachedData {

                @CompilationFinal ReadMemberCachedData next_;
                @CompilationFinal String cachedMember_;
                @CompilationFinal FrameSlot slot_;

                ReadMemberCachedData(ReadMemberCachedData next_) {
                    this.next_ = next_;
                }

            }
            @GeneratedBy(VariablesObject.class)
            private static final class WriteMemberCachedData extends Node {

                @Child WriteMemberCachedData next_;
                @CompilationFinal String cachedMember_;
                @CompilationFinal SLWriteLocalVariableNode writeNode_;

                WriteMemberCachedData(WriteMemberCachedData next_) {
                    this.next_ = next_;
                }

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

            }
            @GeneratedBy(VariablesObject.class)
            private static final class GetMembersNode_GetMembersData extends Node {

                @CompilationFinal(dimensions = 1) SLWriteLocalVariableNode[] writeNodes_;
                @CompilationFinal int visibleVariablesIndex_;
                @CompilationFinal int parentBlockIndex_;

                GetMembersNode_GetMembersData() {
                }

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

            }
        }
        @GeneratedBy(VariablesObject.class)
        private static final class Uncached extends InteropLibrary {

            Uncached() {
            }

            @TruffleBoundary
            @Override
            public boolean accepts(Object receiver) {
                assert !(receiver instanceof VariablesObject) || DYNAMIC_DISPATCH_LIBRARY_.getUncached().dispatch(receiver) == null : "Invalid library export. Exported receiver with dynamic dispatch found but not expected.";
                return receiver instanceof VariablesObject && accepts_(receiver);
            }

            @Override
            public boolean isAdoptable() {
                return false;
            }

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

            @TruffleBoundary
            @Override
            public boolean isMemberReadable(Object arg0Value_, String arg1Value) {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                return ExistsMember.doGeneric(arg0Value, arg1Value);
            }

            @TruffleBoundary
            @Override
            public boolean isMemberModifiable(Object arg0Value_, String arg1Value) {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                return ModifiableMember.doGeneric(arg0Value, arg1Value);
            }

            @TruffleBoundary
            @Override
            public Object readMember(Object arg0Value_, String arg1Value) throws UnknownIdentifierException {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                return ReadMember.doGeneric(arg0Value, arg1Value);
            }

            @TruffleBoundary
            @Override
            public void writeMember(Object arg0Value_, String arg1Value, Object arg2Value) throws UnknownIdentifierException, UnsupportedMessageException {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                WriteMember.doGeneric(arg0Value, arg1Value, arg2Value);
                return;
            }

            @TruffleBoundary
            @Override
            public boolean isScope(Object receiver) {
                assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
                return ((VariablesObject) receiver) .isScope();
            }

            @TruffleBoundary
            @Override
            public boolean hasLanguage(Object receiver) {
                assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
                return ((VariablesObject) receiver) .hasLanguage();
            }

            @TruffleBoundary
            @Override
            public Class> getLanguage(Object receiver) throws UnsupportedMessageException {
                assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
                return ((VariablesObject) receiver) .getLanguage();
            }

            @TruffleBoundary
            @Override
            public Object toDisplayString(Object arg0Value_, boolean arg1Value) {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                return arg0Value.toDisplayString(arg1Value, (arg0Value.block), (arg0Value.block.findBlock()));
            }

            @TruffleBoundary
            @Override
            public boolean hasScopeParent(Object arg0Value_) {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                return arg0Value.hasScopeParent((arg0Value.block), (arg0Value.block.findBlock()));
            }

            @TruffleBoundary
            @Override
            public Object getScopeParent(Object arg0Value_) throws UnsupportedMessageException {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                return arg0Value.getScopeParent((arg0Value.block), (arg0Value.block.findBlock()));
            }

            @TruffleBoundary
            @Override
            public boolean hasSourceLocation(Object receiver) {
                assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
                return ((VariablesObject) receiver) .hasSourceLocation();
            }

            @TruffleBoundary
            @Override
            public SourceSection getSourceLocation(Object receiver) throws UnsupportedMessageException {
                assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
                return ((VariablesObject) receiver) .getSourceLocation();
            }

            @TruffleBoundary
            @Override
            public boolean hasMembers(Object receiver) {
                assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
                return ((VariablesObject) receiver) .hasMembers();
            }

            @TruffleBoundary
            @Override
            public boolean isMemberInsertable(Object receiver, String member) {
                assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
                return ((VariablesObject) receiver) .isMemberInsertable(member);
            }

            @TruffleBoundary
            @Override
            public Object getMembers(Object arg0Value_, boolean arg1Value) {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                return arg0Value.getMembers(arg1Value, (arg0Value.block.getDeclaredLocalVariables()), (arg0Value.getVisibleVariablesIndex()), (arg0Value.block.getParentBlockIndex()));
            }

            @TruffleBoundary
            private static boolean accepts_(Object arg0Value_) {
                VariablesObject arg0Value = ((VariablesObject) arg0Value_);
                return arg0Value.accepts((arg0Value.node), (arg0Value.nodeEnter));
            }

        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy