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

org.pkl.thirdparty.truffle.polyglot.DefaultLanguageViewGen Maven / Gradle / Ivy

Go to download

Fat Jar containing pkl-cli, pkl-codegen-java, pkl-codegen-kotlin, pkl-config-java, pkl-core, pkl-doc, and their shaded third-party dependencies.

There is a newer version: 0.27.1
Show newest version
// CheckStyle: start generated
package org.pkl.thirdparty.truffle.polyglot;

import org.pkl.thirdparty.truffle.api.TruffleLanguage;
import org.pkl.thirdparty.truffle.api.CompilerDirectives.TruffleBoundary;
import org.pkl.thirdparty.truffle.api.dsl.GeneratedBy;
import org.pkl.thirdparty.truffle.api.interop.InteropLibrary;
import org.pkl.thirdparty.truffle.api.interop.UnsupportedMessageException;
import org.pkl.thirdparty.truffle.api.library.DynamicDispatchLibrary;
import org.pkl.thirdparty.truffle.api.library.Library;
import org.pkl.thirdparty.truffle.api.library.LibraryExport;
import org.pkl.thirdparty.truffle.api.library.LibraryFactory;
import org.pkl.thirdparty.truffle.api.nodes.DenyReplace;
import org.pkl.thirdparty.truffle.api.nodes.NodeCost;
import org.pkl.thirdparty.truffle.api.utilities.FinalBitSet;

@GeneratedBy(DefaultLanguageView.class)
@SuppressWarnings("javadoc")
final class DefaultLanguageViewGen {

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

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

    private DefaultLanguageViewGen() {
    }

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

        static final FinalBitSet ENABLED_MESSAGES = createMessageBitSet(INTEROP_LIBRARY_, "hasLanguage", "toDisplayString", "getLanguage");
        private static final Uncached UNCACHED = new Uncached();

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

        @Override
        protected InteropLibrary createUncached(Object receiver) {
            assert receiver instanceof DefaultLanguageView;
            InteropLibrary uncached = createDelegate(INTEROP_LIBRARY_, InteropLibraryExports.UNCACHED);
            return uncached;
        }

        @Override
        protected InteropLibrary createCached(Object receiver) {
            assert receiver instanceof DefaultLanguageView;
            return createDelegate(INTEROP_LIBRARY_, new Cached(receiver));
        }

        @GeneratedBy(DefaultLanguageView.class)
        private static final class Cached extends InteropLibrary implements DelegateExport {

            @Child private InteropLibrary receiverDelegateInteropLibrary_;

            protected Cached(Object receiver) {
                DefaultLanguageView castReceiver = ((DefaultLanguageView) receiver) ;
                this.receiverDelegateInteropLibrary_ = super.insert(INTEROP_LIBRARY_.create((castReceiver.delegate)));
            }

            @Override
            public FinalBitSet getDelegateExportMessages() {
                return ENABLED_MESSAGES;
            }

            @Override
            public Object readDelegateExport(Object receiver_) {
                return ((DefaultLanguageView) receiver_).delegate;
            }

            @Override
            public Library getDelegateExportLibrary(Object delegate) {
                return this.receiverDelegateInteropLibrary_;
            }

            @Override
            public boolean accepts(Object receiver) {
                assert !(receiver instanceof DefaultLanguageView) || DYNAMIC_DISPATCH_LIBRARY_.getUncached().dispatch(receiver) == null : "Invalid library export. Exported receiver with dynamic dispatch found but not expected.";
                if (!(receiver instanceof DefaultLanguageView)) {
                    return false;
                } else if (!this.receiverDelegateInteropLibrary_.accepts((((DefaultLanguageView) receiver).delegate))) {
                    return false;
                } else {
                    return true;
                }
            }

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

            /**
             * Debug Info: 
             *   Specialization {@link DefaultLanguageView#toDisplayString(DefaultLanguageView, boolean, InteropLibrary)}
             *     Activation probability: 0.50000
             *     With/without class size: 10/0 bytes
             * 
*/ @Override public Object toDisplayString(Object arg0Value_, boolean arg1Value) { assert arg0Value_ instanceof DefaultLanguageView : "Invalid library usage. Library does not accept given receiver."; DefaultLanguageView arg0Value = ((DefaultLanguageView) arg0Value_); { InteropLibrary delegateLibrary__ = this.receiverDelegateInteropLibrary_; return arg0Value.toDisplayString(arg1Value, delegateLibrary__); } } @Override public NodeCost getCost() { return NodeCost.MONOMORPHIC; } @Override public Class> getLanguage(Object receiver) throws UnsupportedMessageException { assert receiver instanceof DefaultLanguageView : "Invalid library usage. Library does not accept given receiver."; return (((DefaultLanguageView) receiver)).getLanguage(); } } @GeneratedBy(DefaultLanguageView.class) @DenyReplace private static final class Uncached extends InteropLibrary implements DelegateExport { protected Uncached() { } @Override public FinalBitSet getDelegateExportMessages() { return ENABLED_MESSAGES; } @Override public Object readDelegateExport(Object receiver_) { return (((DefaultLanguageView) receiver_)).delegate; } @Override public Library getDelegateExportLibrary(Object delegate_) { return INTEROP_LIBRARY_.getUncached(delegate_); } @Override @TruffleBoundary public boolean accepts(Object receiver) { assert !(receiver instanceof DefaultLanguageView) || DYNAMIC_DISPATCH_LIBRARY_.getUncached().dispatch(receiver) == null : "Invalid library export. Exported receiver with dynamic dispatch found but not expected."; return receiver instanceof DefaultLanguageView; } @Override public boolean isAdoptable() { return false; } @Override public NodeCost getCost() { return NodeCost.MEGAMORPHIC; } @TruffleBoundary @Override public boolean hasLanguage(Object receiver) { // declared: true assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver."; return ((DefaultLanguageView) receiver) .hasLanguage(); } @TruffleBoundary @Override public Object toDisplayString(Object arg0Value_, boolean arg1Value) { // declared: true assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver."; DefaultLanguageView arg0Value = ((DefaultLanguageView) arg0Value_); return arg0Value.toDisplayString(arg1Value, INTEROP_LIBRARY_.getUncached((arg0Value.delegate))); } @TruffleBoundary @Override public Class> getLanguage(Object receiver) throws UnsupportedMessageException { // declared: true assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver."; return ((DefaultLanguageView) receiver) .getLanguage(); } } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy