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

com.oracle.truffle.nfi.backend.libffi.LibFFISignatureGen Maven / Gradle / Ivy

// CheckStyle: start generated
package com.oracle.truffle.nfi.backend.libffi;

import com.oracle.truffle.api.Assumption;
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.GenerateAOT;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.interop.ArityException;
import com.oracle.truffle.api.interop.InteropLibrary;
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.EagerExportProvider;
import com.oracle.truffle.api.library.LibraryExport;
import com.oracle.truffle.api.library.LibraryFactory;
import com.oracle.truffle.api.memory.MemoryFence;
import com.oracle.truffle.api.nodes.EncapsulatingNodeReference;
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.nodes.RootNode;
import com.oracle.truffle.api.profiles.BranchProfile;
import com.oracle.truffle.nfi.backend.libffi.LibFFIClosure.MonomorphicClosureInfo;
import com.oracle.truffle.nfi.backend.libffi.LibFFIClosure.PolymorphicClosureInfo;
import com.oracle.truffle.nfi.backend.libffi.LibFFISignature.CachedSignatureInfo;
import com.oracle.truffle.nfi.backend.libffi.LibFFISignature.CreateClosure;
import com.oracle.truffle.nfi.backend.spi.NFIBackendSignatureLibrary;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

@GeneratedBy(LibFFISignature.class)
@SuppressWarnings("unused")
public final class LibFFISignatureGen {

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

    static  {
        LibraryExport.register(LibFFISignature.class, new NFIBackendSignatureLibraryExports());
    }

    private LibFFISignatureGen() {
    }

    private static void init() {
        // This method is intended to ensure class initialization.
    }

    @GeneratedBy(LibFFISignature.class)
    public static final class NFIBackendSignatureLibraryEagerProvider implements EagerExportProvider {

        @Override
        public void ensureRegistered() {
            LibFFISignatureGen.init();
        }

        @Override
        public String getLibraryClassName() {
            return "com.oracle.truffle.nfi.backend.spi.NFIBackendSignatureLibrary";
        }

    }
    @GeneratedBy(LibFFISignature.class)
    private static final class NFIBackendSignatureLibraryExports extends LibraryExport {

        private NFIBackendSignatureLibraryExports() {
            super(NFIBackendSignatureLibrary.class, LibFFISignature.class, false, true, 1);
        }

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

        @Override
        protected NFIBackendSignatureLibrary createCached(Object receiver) {
            assert receiver instanceof LibFFISignature || receiver instanceof LibraryExport;
            return new Cached();
        }

        @GeneratedBy(LibFFISignature.class)
        private static final class Cached extends NFIBackendSignatureLibrary implements GenerateAOT.Provider {

            @CompilationFinal private volatile int state_0_;
            @CompilationFinal private volatile int exclude_;
            @Child private CreateClosureCachedExecutableData createClosure_cachedExecutable_cache;
            @Child private CreateClosureCachedSignatureData createClosure_cachedSignature_cache;
            @Child private CallNode_Call0Data callNode__call0_cache;
            @CompilationFinal private BranchProfile callNode__call1_toNative_;
            @CompilationFinal private BranchProfile callNode__call1_error_;
            @Child private FunctionExecuteNode callNode__call1_functionExecute_;

            protected Cached() {
            }

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

            @ExplodeLoop
            @Override
            public Object createClosure(Object arg0Value_, Object arg1Value) {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                assert getRootNode() != null : "Invalid libray usage. Cached library must be adopted by a RootNode before it is executed.";
                LibFFISignature arg0Value = ((LibFFISignature) arg0Value_);
                int state_0 = this.state_0_;
                if (CompilerDirectives.inInterpreter() && (state_0 & 0b1) != 0 /* is-state_0 AOT-prepared */) {
                    return createClosureAndSpecialize(arg0Value, arg1Value);
                }
                if ((state_0 & 0b1110) != 0 /* is-state_0 doCachedExecutable(LibFFISignature, Object, CachedSignatureInfo, Object, NFIBackendSignatureLibrary, MonomorphicClosureInfo) || doCachedSignature(LibFFISignature, Object, CachedSignatureInfo, NFIBackendSignatureLibrary, PolymorphicClosureInfo) || createClosure(LibFFISignature, Object, NFIBackendSignatureLibrary) */) {
                    if ((state_0 & 0b10) != 0 /* is-state_0 doCachedExecutable(LibFFISignature, Object, CachedSignatureInfo, Object, NFIBackendSignatureLibrary, MonomorphicClosureInfo) */) {
                        CreateClosureCachedExecutableData s0_ = this.createClosure_cachedExecutable_cache;
                        while (s0_ != null) {
                            if (!Assumption.isValidAssumption(s0_.assumption0_)) {
                                CompilerDirectives.transferToInterpreterAndInvalidate();
                                removeCachedExecutable_(s0_);
                                return createClosureAndSpecialize(arg0Value, arg1Value);
                            }
                            if ((arg0Value.signatureInfo == s0_.cachedSignatureInfo_) && (arg1Value == s0_.cachedExecutable_)) {
                                NFIBackendSignatureLibrary self__ = (this);
                                return CreateClosure.doCachedExecutable(arg0Value, arg1Value, s0_.cachedSignatureInfo_, s0_.cachedExecutable_, self__, s0_.cachedClosureInfo_);
                            }
                            s0_ = s0_.next_;
                        }
                    }
                    if ((state_0 & 0b100) != 0 /* is-state_0 doCachedSignature(LibFFISignature, Object, CachedSignatureInfo, NFIBackendSignatureLibrary, PolymorphicClosureInfo) */) {
                        CreateClosureCachedSignatureData s1_ = this.createClosure_cachedSignature_cache;
                        while (s1_ != null) {
                            if ((arg0Value.signatureInfo == s1_.cachedSignatureInfo_)) {
                                NFIBackendSignatureLibrary self__1 = (this);
                                return CreateClosure.doCachedSignature(arg0Value, arg1Value, s1_.cachedSignatureInfo_, self__1, s1_.cachedClosureInfo_);
                            }
                            s1_ = s1_.next_;
                        }
                    }
                    if ((state_0 & 0b1000) != 0 /* is-state_0 createClosure(LibFFISignature, Object, NFIBackendSignatureLibrary) */) {
                        {
                            NFIBackendSignatureLibrary createClosure_createClosure_self__ = (this);
                            return CreateClosure.createClosure(arg0Value, arg1Value, createClosure_createClosure_self__);
                        }
                    }
                }
                CompilerDirectives.transferToInterpreterAndInvalidate();
                return createClosureAndSpecialize(arg0Value, arg1Value);
            }

            private LibFFIClosure createClosureAndSpecialize(LibFFISignature arg0Value, Object arg1Value) {
                Lock lock = getLock();
                boolean hasLock = true;
                lock.lock();
                try {
                    if ((this.state_0_ & 0b1) != 0 /* is-state_0 AOT-prepared */) {
                        this.resetAOT_();
                    }
                    int state_0 = this.state_0_;
                    int exclude = this.exclude_;
                    {
                        NFIBackendSignatureLibrary self__ = null;
                        if (((exclude & 0b1)) == 0 /* is-not-exclude doCachedExecutable(LibFFISignature, Object, CachedSignatureInfo, Object, NFIBackendSignatureLibrary, MonomorphicClosureInfo) */) {
                            int count0_ = 0;
                            CreateClosureCachedExecutableData s0_ = this.createClosure_cachedExecutable_cache;
                            if ((state_0 & 0b10) != 0 /* is-state_0 doCachedExecutable(LibFFISignature, Object, CachedSignatureInfo, Object, NFIBackendSignatureLibrary, MonomorphicClosureInfo) */) {
                                while (s0_ != null) {
                                    if ((arg0Value.signatureInfo == s0_.cachedSignatureInfo_) && (arg1Value == s0_.cachedExecutable_) && (s0_.assumption0_ == null || Assumption.isValidAssumption(s0_.assumption0_))) {
                                        self__ = (this);
                                        break;
                                    }
                                    s0_ = s0_.next_;
                                    count0_++;
                                }
                            }
                            if (s0_ == null) {
                                // assert (arg0Value.signatureInfo == s0_.cachedSignatureInfo_);
                                // assert (arg1Value == s0_.cachedExecutable_);
                                {
                                    Assumption assumption0 = (LibFFILanguage.getSingleContextAssumption());
                                    if (Assumption.isValidAssumption(assumption0)) {
                                        if (count0_ < (3)) {
                                            s0_ = super.insert(new CreateClosureCachedExecutableData(createClosure_cachedExecutable_cache));
                                            s0_.cachedSignatureInfo_ = (arg0Value.signatureInfo);
                                            s0_.cachedExecutable_ = (arg1Value);
                                            self__ = (this);
                                            s0_.cachedClosureInfo_ = (MonomorphicClosureInfo.create(s0_.cachedSignatureInfo_, s0_.cachedExecutable_));
                                            s0_.assumption0_ = assumption0;
                                            MemoryFence.storeStore();
                                            this.createClosure_cachedExecutable_cache = s0_;
                                            this.state_0_ = state_0 = state_0 | 0b10 /* add-state_0 doCachedExecutable(LibFFISignature, Object, CachedSignatureInfo, Object, NFIBackendSignatureLibrary, MonomorphicClosureInfo) */;
                                        }
                                    }
                                }
                            }
                            if (s0_ != null) {
                                lock.unlock();
                                hasLock = false;
                                return CreateClosure.doCachedExecutable(arg0Value, arg1Value, s0_.cachedSignatureInfo_, s0_.cachedExecutable_, self__, s0_.cachedClosureInfo_);
                            }
                        }
                    }
                    {
                        NFIBackendSignatureLibrary self__1 = null;
                        if (((exclude & 0b10)) == 0 /* is-not-exclude doCachedSignature(LibFFISignature, Object, CachedSignatureInfo, NFIBackendSignatureLibrary, PolymorphicClosureInfo) */) {
                            int count1_ = 0;
                            CreateClosureCachedSignatureData s1_ = this.createClosure_cachedSignature_cache;
                            if ((state_0 & 0b100) != 0 /* is-state_0 doCachedSignature(LibFFISignature, Object, CachedSignatureInfo, NFIBackendSignatureLibrary, PolymorphicClosureInfo) */) {
                                while (s1_ != null) {
                                    if ((arg0Value.signatureInfo == s1_.cachedSignatureInfo_)) {
                                        self__1 = (this);
                                        break;
                                    }
                                    s1_ = s1_.next_;
                                    count1_++;
                                }
                            }
                            if (s1_ == null) {
                                // assert (arg0Value.signatureInfo == s1_.cachedSignatureInfo_);
                                if (count1_ < (3)) {
                                    s1_ = super.insert(new CreateClosureCachedSignatureData(createClosure_cachedSignature_cache));
                                    s1_.cachedSignatureInfo_ = (arg0Value.signatureInfo);
                                    self__1 = (this);
                                    s1_.cachedClosureInfo_ = (PolymorphicClosureInfo.create(s1_.cachedSignatureInfo_));
                                    MemoryFence.storeStore();
                                    this.createClosure_cachedSignature_cache = s1_;
                                    this.exclude_ = exclude = exclude | 0b1 /* add-exclude doCachedExecutable(LibFFISignature, Object, CachedSignatureInfo, Object, NFIBackendSignatureLibrary, MonomorphicClosureInfo) */;
                                    this.createClosure_cachedExecutable_cache = null;
                                    state_0 = state_0 & 0xfffffffd /* remove-state_0 doCachedExecutable(LibFFISignature, Object, CachedSignatureInfo, Object, NFIBackendSignatureLibrary, MonomorphicClosureInfo) */;
                                    this.state_0_ = state_0 = state_0 | 0b100 /* add-state_0 doCachedSignature(LibFFISignature, Object, CachedSignatureInfo, NFIBackendSignatureLibrary, PolymorphicClosureInfo) */;
                                }
                            }
                            if (s1_ != null) {
                                lock.unlock();
                                hasLock = false;
                                return CreateClosure.doCachedSignature(arg0Value, arg1Value, s1_.cachedSignatureInfo_, self__1, s1_.cachedClosureInfo_);
                            }
                        }
                    }
                    {
                        NFIBackendSignatureLibrary createClosure_createClosure_self__ = null;
                        createClosure_createClosure_self__ = (this);
                        this.exclude_ = exclude = exclude | 0b11 /* add-exclude doCachedExecutable(LibFFISignature, Object, CachedSignatureInfo, Object, NFIBackendSignatureLibrary, MonomorphicClosureInfo), doCachedSignature(LibFFISignature, Object, CachedSignatureInfo, NFIBackendSignatureLibrary, PolymorphicClosureInfo) */;
                        this.createClosure_cachedExecutable_cache = null;
                        this.createClosure_cachedSignature_cache = null;
                        state_0 = state_0 & 0xfffffff9 /* remove-state_0 doCachedExecutable(LibFFISignature, Object, CachedSignatureInfo, Object, NFIBackendSignatureLibrary, MonomorphicClosureInfo), doCachedSignature(LibFFISignature, Object, CachedSignatureInfo, NFIBackendSignatureLibrary, PolymorphicClosureInfo) */;
                        this.state_0_ = state_0 = state_0 | 0b1000 /* add-state_0 createClosure(LibFFISignature, Object, NFIBackendSignatureLibrary) */;
                        lock.unlock();
                        hasLock = false;
                        return CreateClosure.createClosure(arg0Value, arg1Value, createClosure_createClosure_self__);
                    }
                } finally {
                    if (hasLock) {
                        lock.unlock();
                    }
                }
            }

            @Override
            public NodeCost getCost() {
                int state_0 = this.state_0_;
                if ((state_0 & 0b1110) == 0) {
                    return NodeCost.UNINITIALIZED;
                } else {
                    if (((state_0 & 0b1110) & ((state_0 & 0b1110) - 1)) == 0 /* is-single-state_0  */) {
                        CreateClosureCachedExecutableData s0_ = this.createClosure_cachedExecutable_cache;
                        CreateClosureCachedSignatureData s1_ = this.createClosure_cachedSignature_cache;
                        if ((s0_ == null || s0_.next_ == null) && (s1_ == null || s1_.next_ == null)) {
                            return NodeCost.MONOMORPHIC;
                        }
                    }
                }
                return NodeCost.POLYMORPHIC;
            }

            void removeCachedExecutable_(Object s0_) {
                Lock lock = getLock();
                lock.lock();
                try {
                    CreateClosureCachedExecutableData prev = null;
                    CreateClosureCachedExecutableData cur = this.createClosure_cachedExecutable_cache;
                    while (cur != null) {
                        if (cur == s0_) {
                            if (prev == null) {
                                this.createClosure_cachedExecutable_cache = cur.next_;
                                this.adoptChildren();
                            } else {
                                prev.next_ = cur.next_;
                                prev.adoptChildren();
                            }
                            break;
                        }
                        prev = cur;
                        cur = cur.next_;
                    }
                    if (this.createClosure_cachedExecutable_cache == null) {
                        this.state_0_ = this.state_0_ & 0xfffffffd /* remove-state_0 doCachedExecutable(LibFFISignature, Object, CachedSignatureInfo, Object, NFIBackendSignatureLibrary, MonomorphicClosureInfo) */;
                    }
                } finally {
                    lock.unlock();
                }
            }

            @Override
            public void prepareForAOT(TruffleLanguage language, RootNode root) {
                assert !isAdoptable() || ((ReentrantLock) getLock()).isHeldByCurrentThread() : "During prepare AST lock must be held.";
                int state_0 = this.state_0_;
                if ((state_0 & 0b1) != 0 /* is-state_0 AOT-prepared */) {
                    return;
                }
                this.exclude_ = this.exclude_ | 0b11 /* add-exclude doCachedExecutable(LibFFISignature, Object, CachedSignatureInfo, Object, NFIBackendSignatureLibrary, MonomorphicClosureInfo), doCachedSignature(LibFFISignature, Object, CachedSignatureInfo, NFIBackendSignatureLibrary, PolymorphicClosureInfo) */;
                this.createClosure_cachedExecutable_cache = null;
                this.createClosure_cachedSignature_cache = null;
                state_0 = state_0 & 0xfffffff9 /* remove-state_0 doCachedExecutable(LibFFISignature, Object, CachedSignatureInfo, Object, NFIBackendSignatureLibrary, MonomorphicClosureInfo), doCachedSignature(LibFFISignature, Object, CachedSignatureInfo, NFIBackendSignatureLibrary, PolymorphicClosureInfo) */;
                this.state_0_ = state_0 = state_0 | 0b1001 /* add-state_0 AOT-prepared, createClosure(LibFFISignature, Object, NFIBackendSignatureLibrary) */;
            }

            private void resetAOT_() {
                int state_0 = this.state_0_;
                if (((state_0 & 0b1)) == 0 /* is-not-state_0 AOT-prepared */) {
                    return;
                }
                this.state_0_ = 0;
                this.exclude_ = 0;
            }

            @ExplodeLoop
            @Override
            public Object call(Object arg0Value_, Object arg1Value, Object... arg2Value) throws ArityException, UnsupportedTypeException, UnsupportedMessageException {
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                assert getRootNode() != null : "Invalid libray usage. Cached library must be adopted by a RootNode before it is executed.";
                LibFFISignature arg0Value = ((LibFFISignature) arg0Value_);
                int state_0 = this.state_0_;
                if (CompilerDirectives.inInterpreter() && (state_0 & 0b1) != 0 /* is-state_0 AOT-prepared */) {
                    return callNode_AndSpecialize(arg0Value, arg1Value, arg2Value);
                }
                if ((state_0 & 0b110000) != 0 /* is-state_0 call(LibFFISignature, Object, Object[], InteropLibrary, BranchProfile, BranchProfile, FunctionExecuteNode) || call(LibFFISignature, Object, Object[], InteropLibrary, BranchProfile, BranchProfile, FunctionExecuteNode) */) {
                    if ((state_0 & 0b10000) != 0 /* is-state_0 call(LibFFISignature, Object, Object[], InteropLibrary, BranchProfile, BranchProfile, FunctionExecuteNode) */) {
                        CallNode_Call0Data s0_ = this.callNode__call0_cache;
                        while (s0_ != null) {
                            if ((s0_.interop_.accepts(arg1Value))) {
                                return LibFFISignature.call(arg0Value, arg1Value, arg2Value, s0_.interop_, s0_.toNative_, s0_.error_, s0_.functionExecute_);
                            }
                            s0_ = s0_.next_;
                        }
                    }
                    if ((state_0 & 0b100000) != 0 /* is-state_0 call(LibFFISignature, Object, Object[], InteropLibrary, BranchProfile, BranchProfile, FunctionExecuteNode) */) {
                        return this.call1Boundary(state_0, arg0Value, arg1Value, arg2Value);
                    }
                }
                CompilerDirectives.transferToInterpreterAndInvalidate();
                return callNode_AndSpecialize(arg0Value, arg1Value, arg2Value);
            }

            @SuppressWarnings("static-method")
            @TruffleBoundary
            private Object call1Boundary(int state_0, LibFFISignature arg0Value, Object arg1Value, Object[] arg2Value) throws ArityException, UnsupportedTypeException, UnsupportedMessageException {
                EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
                Node prev_ = encapsulating_.set(this);
                try {
                    {
                        InteropLibrary callNode__call1_interop__ = (INTEROP_LIBRARY_.getUncached(arg1Value));
                        return LibFFISignature.call(arg0Value, arg1Value, arg2Value, callNode__call1_interop__, this.callNode__call1_toNative_, this.callNode__call1_error_, this.callNode__call1_functionExecute_);
                    }
                } finally {
                    encapsulating_.set(prev_);
                }
            }

            private Object callNode_AndSpecialize(LibFFISignature arg0Value, Object arg1Value, Object[] arg2Value) throws ArityException, UnsupportedTypeException {
                Lock lock = getLock();
                boolean hasLock = true;
                lock.lock();
                try {
                    if ((this.state_0_ & 0b1) != 0 /* is-state_0 AOT-prepared */) {
                        this.resetAOT_();
                    }
                    int state_0 = this.state_0_;
                    int exclude = this.exclude_;
                    if (((exclude & 0b100)) == 0 /* is-not-exclude call(LibFFISignature, Object, Object[], InteropLibrary, BranchProfile, BranchProfile, FunctionExecuteNode) */) {
                        int count0_ = 0;
                        CallNode_Call0Data s0_ = this.callNode__call0_cache;
                        if ((state_0 & 0b10000) != 0 /* is-state_0 call(LibFFISignature, Object, Object[], InteropLibrary, BranchProfile, BranchProfile, FunctionExecuteNode) */) {
                            while (s0_ != null) {
                                if ((s0_.interop_.accepts(arg1Value))) {
                                    break;
                                }
                                s0_ = s0_.next_;
                                count0_++;
                            }
                        }
                        if (s0_ == null) {
                            // assert (s0_.interop_.accepts(arg1Value));
                            if (count0_ < (3)) {
                                s0_ = super.insert(new CallNode_Call0Data(callNode__call0_cache));
                                s0_.interop_ = s0_.insertAccessor((INTEROP_LIBRARY_.create(arg1Value)));
                                s0_.toNative_ = (BranchProfile.create());
                                s0_.error_ = (BranchProfile.create());
                                s0_.functionExecute_ = s0_.insertAccessor((FunctionExecuteNodeGen.create()));
                                MemoryFence.storeStore();
                                this.callNode__call0_cache = s0_;
                                this.state_0_ = state_0 = state_0 | 0b10000 /* add-state_0 call(LibFFISignature, Object, Object[], InteropLibrary, BranchProfile, BranchProfile, FunctionExecuteNode) */;
                            }
                        }
                        if (s0_ != null) {
                            lock.unlock();
                            hasLock = false;
                            return LibFFISignature.call(arg0Value, arg1Value, arg2Value, s0_.interop_, s0_.toNative_, s0_.error_, s0_.functionExecute_);
                        }
                    }
                    {
                        InteropLibrary callNode__call1_interop__ = null;
                        {
                            EncapsulatingNodeReference encapsulating_ = EncapsulatingNodeReference.getCurrent();
                            Node prev_ = encapsulating_.set(this);
                            try {
                                callNode__call1_interop__ = (INTEROP_LIBRARY_.getUncached(arg1Value));
                                this.callNode__call1_toNative_ = (BranchProfile.create());
                                this.callNode__call1_error_ = (BranchProfile.create());
                                this.callNode__call1_functionExecute_ = super.insert((FunctionExecuteNodeGen.create()));
                                this.exclude_ = exclude = exclude | 0b100 /* add-exclude call(LibFFISignature, Object, Object[], InteropLibrary, BranchProfile, BranchProfile, FunctionExecuteNode) */;
                                this.callNode__call0_cache = null;
                                state_0 = state_0 & 0xffffffef /* remove-state_0 call(LibFFISignature, Object, Object[], InteropLibrary, BranchProfile, BranchProfile, FunctionExecuteNode) */;
                                this.state_0_ = state_0 = state_0 | 0b100000 /* add-state_0 call(LibFFISignature, Object, Object[], InteropLibrary, BranchProfile, BranchProfile, FunctionExecuteNode) */;
                                lock.unlock();
                                hasLock = false;
                                return LibFFISignature.call(arg0Value, arg1Value, arg2Value, callNode__call1_interop__, this.callNode__call1_toNative_, this.callNode__call1_error_, this.callNode__call1_functionExecute_);
                            } finally {
                                encapsulating_.set(prev_);
                            }
                        }
                    }
                } finally {
                    if (hasLock) {
                        lock.unlock();
                    }
                }
            }

            @GeneratedBy(LibFFISignature.class)
            private static final class CreateClosureCachedExecutableData extends Node {

                @Child CreateClosureCachedExecutableData next_;
                @CompilationFinal CachedSignatureInfo cachedSignatureInfo_;
                @CompilationFinal Object cachedExecutable_;
                @CompilationFinal MonomorphicClosureInfo cachedClosureInfo_;
                @CompilationFinal Assumption assumption0_;

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

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

            }
            @GeneratedBy(LibFFISignature.class)
            private static final class CreateClosureCachedSignatureData extends Node {

                @Child CreateClosureCachedSignatureData next_;
                @CompilationFinal CachedSignatureInfo cachedSignatureInfo_;
                @CompilationFinal PolymorphicClosureInfo cachedClosureInfo_;

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

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

            }
            @GeneratedBy(LibFFISignature.class)
            private static final class CallNode_Call0Data extends Node {

                @Child CallNode_Call0Data next_;
                @Child InteropLibrary interop_;
                @CompilationFinal BranchProfile toNative_;
                @CompilationFinal BranchProfile error_;
                @Child FunctionExecuteNode functionExecute_;

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

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

                 T insertAccessor(T node) {
                    return super.insert(node);
                }

            }
        }
        @GeneratedBy(LibFFISignature.class)
        private static final class Uncached extends NFIBackendSignatureLibrary {

            protected Uncached() {
            }

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

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

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

            @TruffleBoundary
            @Override
            public Object createClosure(Object arg0Value_, Object arg1Value) {
                // declared: true
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                LibFFISignature arg0Value = ((LibFFISignature) arg0Value_);
                return CreateClosure.createClosure(arg0Value, arg1Value, (this));
            }

            @TruffleBoundary
            @Override
            public Object call(Object arg0Value_, Object arg1Value, Object... arg2Value) throws ArityException, UnsupportedTypeException {
                // declared: true
                assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver.";
                LibFFISignature arg0Value = ((LibFFISignature) arg0Value_);
                return LibFFISignature.call(arg0Value, arg1Value, arg2Value, (INTEROP_LIBRARY_.getUncached(arg1Value)), (BranchProfile.getUncached()), (BranchProfile.getUncached()), (FunctionExecuteNodeGen.getUncached()));
            }

        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy