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

com.oracle.truffle.js.runtime.objects.JSNonProxyObjectGen Maven / Gradle / Ivy

// CheckStyle: start generated
package com.oracle.truffle.js.runtime.objects;

import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.interop.InteropLibrary;
import com.oracle.truffle.api.interop.UnsupportedMessageException;
import com.oracle.truffle.api.library.LibraryExport;

@GeneratedBy(JSNonProxyObject.class)
public final class JSNonProxyObjectGen {

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

    private JSNonProxyObjectGen() {
    }

    @GeneratedBy(JSNonProxyObject.class)
    public static class InteropLibraryExports extends LibraryExport {

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

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

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

        @GeneratedBy(JSNonProxyObject.class)
        public static class Cached extends JSObjectGen.InteropLibraryExports.Cached {

            protected Cached(Object receiver) {
                super(receiver);
            }

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

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

        }
        @GeneratedBy(JSNonProxyObject.class)
        public static class Uncached extends JSObjectGen.InteropLibraryExports.Uncached {

            protected Uncached(Object receiver) {
                super(receiver);
            }

            @Override
            @TruffleBoundary
            public boolean accepts(Object receiver) {
                return super.accepts(receiver);
            }

            @TruffleBoundary
            @Override
            public boolean hasMetaObject(Object receiver) {
                // declared: true
                assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
                return ((JSNonProxyObject) receiver) .hasMetaObject();
            }

            @TruffleBoundary
            @Override
            public Object getMetaObject(Object receiver) throws UnsupportedMessageException {
                // declared: true
                assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver.";
                return ((JSNonProxyObject) receiver) .getMetaObject();
            }

        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy