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

org.pkl.thirdparty.truffle.host.HostAdapterSuperMembersGen 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.host;

import org.pkl.thirdparty.truffle.api.CompilerDirectives;
import org.pkl.thirdparty.truffle.api.CompilerDirectives.CompilationFinal;
import org.pkl.thirdparty.truffle.api.CompilerDirectives.TruffleBoundary;
import org.pkl.thirdparty.truffle.api.dsl.GeneratedBy;
import org.pkl.thirdparty.truffle.api.interop.ArityException;
import org.pkl.thirdparty.truffle.api.interop.InteropLibrary;
import org.pkl.thirdparty.truffle.api.interop.UnknownIdentifierException;
import org.pkl.thirdparty.truffle.api.interop.UnsupportedMessageException;
import org.pkl.thirdparty.truffle.api.interop.UnsupportedTypeException;
import org.pkl.thirdparty.truffle.api.library.DynamicDispatchLibrary;
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.host.HostAdapterSuperMembers.NameCache;
import java.lang.invoke.VarHandle;

@GeneratedBy(HostAdapterSuperMembers.class)
@SuppressWarnings("javadoc")
final class HostAdapterSuperMembersGen {

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

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

    private HostAdapterSuperMembersGen() {
    }

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

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

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

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

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

            @Child private InteropLibrary receiverAdapterInteropLibrary_;
            /**
             * State Info: 
             *   0: SpecializationActive {@link HostAdapterSuperMembers#readMember(HostAdapterSuperMembers, String, NameCache, InteropLibrary)}
             *   1: SpecializationActive {@link HostAdapterSuperMembers#invokeMember(HostAdapterSuperMembers, String, Object[], NameCache, InteropLibrary)}
             *   2: SpecializationActive {@link HostAdapterSuperMembers#isMemberReadable(HostAdapterSuperMembers, String, NameCache, InteropLibrary)}
             *   3: SpecializationActive {@link HostAdapterSuperMembers#isMemberInvocable(HostAdapterSuperMembers, String, NameCache, InteropLibrary)}
             * 
*/ @CompilationFinal private int state_0_; /** * Source Info:
             *   Specialization: {@link HostAdapterSuperMembers#readMember}
             *   Parameter: {@link NameCache} cache
*/ @CompilationFinal private NameCache cache; protected Cached(Object receiver) { HostAdapterSuperMembers castReceiver = ((HostAdapterSuperMembers) receiver) ; this.receiverAdapterInteropLibrary_ = super.insert(INTEROP_LIBRARY_.create((castReceiver.adapter))); } @Override public boolean accepts(Object receiver) { assert !(receiver instanceof HostAdapterSuperMembers) || DYNAMIC_DISPATCH_LIBRARY_.getUncached().dispatch(receiver) == null : "Invalid library export. Exported receiver with dynamic dispatch found but not expected."; if (!(receiver instanceof HostAdapterSuperMembers)) { return false; } else if (!this.receiverAdapterInteropLibrary_.accepts((((HostAdapterSuperMembers) receiver).adapter))) { return false; } else { return true; } } @Override public boolean hasMembers(Object receiver) { assert receiver instanceof HostAdapterSuperMembers : "Invalid library usage. Library does not accept given receiver."; assert assertAdopted(); return (((HostAdapterSuperMembers) receiver)).hasMembers(); } /** * Debug Info:
             *   Specialization {@link HostAdapterSuperMembers#readMember(HostAdapterSuperMembers, String, NameCache, InteropLibrary)}
             *     Activation probability: 0.25000
             *     With/without class size: 7/0 bytes
             * 
*/ @Override public Object readMember(Object arg0Value_, String arg1Value) throws UnsupportedMessageException, UnknownIdentifierException { assert arg0Value_ instanceof HostAdapterSuperMembers : "Invalid library usage. Library does not accept given receiver."; assert assertAdopted(); HostAdapterSuperMembers arg0Value = ((HostAdapterSuperMembers) arg0Value_); int state_0 = this.state_0_; if ((state_0 & 0b1) != 0 /* is SpecializationActive[HostAdapterSuperMembers.readMember(HostAdapterSuperMembers, String, NameCache, InteropLibrary)] */) { { NameCache cache_ = this.cache; if (cache_ != null) { InteropLibrary interop__ = this.receiverAdapterInteropLibrary_; return arg0Value.readMember(arg1Value, cache_, interop__); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return readMemberNode_AndSpecialize(arg0Value, arg1Value); } private Object readMemberNode_AndSpecialize(HostAdapterSuperMembers arg0Value, String arg1Value) throws UnsupportedMessageException, UnknownIdentifierException { int state_0 = this.state_0_; { InteropLibrary interop__ = null; NameCache cache_; NameCache cache__shared = this.cache; if (cache__shared != null) { cache_ = cache__shared; } else { cache_ = (NameCache.create()); if (cache_ == null) { throw new IllegalStateException("Specialization 'readMember(HostAdapterSuperMembers, String, NameCache, InteropLibrary)' contains a shared cache with name 'cache' that returned a default value for the cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state."); } } if (this.cache == null) { VarHandle.storeStoreFence(); this.cache = cache_; } interop__ = this.receiverAdapterInteropLibrary_; state_0 = state_0 | 0b1 /* add SpecializationActive[HostAdapterSuperMembers.readMember(HostAdapterSuperMembers, String, NameCache, InteropLibrary)] */; this.state_0_ = state_0; return arg0Value.readMember(arg1Value, cache_, interop__); } } @Override public NodeCost getCost() { int state_0 = this.state_0_; if ((state_0 & 0b1) == 0) { return NodeCost.UNINITIALIZED; } else { return NodeCost.MONOMORPHIC; } } /** * Debug Info:
             *   Specialization {@link HostAdapterSuperMembers#invokeMember(HostAdapterSuperMembers, String, Object[], NameCache, InteropLibrary)}
             *     Activation probability: 0.25000
             *     With/without class size: 7/0 bytes
             * 
*/ @Override public Object invokeMember(Object arg0Value_, String arg1Value, Object... arg2Value) throws UnsupportedMessageException, ArityException, UnknownIdentifierException, UnsupportedTypeException { assert arg0Value_ instanceof HostAdapterSuperMembers : "Invalid library usage. Library does not accept given receiver."; assert assertAdopted(); HostAdapterSuperMembers arg0Value = ((HostAdapterSuperMembers) arg0Value_); int state_0 = this.state_0_; if ((state_0 & 0b10) != 0 /* is SpecializationActive[HostAdapterSuperMembers.invokeMember(HostAdapterSuperMembers, String, Object[], NameCache, InteropLibrary)] */) { { NameCache cache_ = this.cache; if (cache_ != null) { InteropLibrary interop__ = this.receiverAdapterInteropLibrary_; return arg0Value.invokeMember(arg1Value, arg2Value, cache_, interop__); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return invokeMemberNode_AndSpecialize(arg0Value, arg1Value, arg2Value); } private Object invokeMemberNode_AndSpecialize(HostAdapterSuperMembers arg0Value, String arg1Value, Object[] arg2Value) throws UnsupportedMessageException, ArityException, UnknownIdentifierException, UnsupportedTypeException { int state_0 = this.state_0_; { InteropLibrary interop__ = null; NameCache cache_; NameCache cache__shared = this.cache; if (cache__shared != null) { cache_ = cache__shared; } else { cache_ = (NameCache.create()); if (cache_ == null) { throw new IllegalStateException("Specialization 'invokeMember(HostAdapterSuperMembers, String, Object[], NameCache, InteropLibrary)' contains a shared cache with name 'cache' that returned a default value for the cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state."); } } if (this.cache == null) { VarHandle.storeStoreFence(); this.cache = cache_; } interop__ = this.receiverAdapterInteropLibrary_; state_0 = state_0 | 0b10 /* add SpecializationActive[HostAdapterSuperMembers.invokeMember(HostAdapterSuperMembers, String, Object[], NameCache, InteropLibrary)] */; this.state_0_ = state_0; return arg0Value.invokeMember(arg1Value, arg2Value, cache_, interop__); } } /** * Debug Info:
             *   Specialization {@link HostAdapterSuperMembers#isMemberReadable(HostAdapterSuperMembers, String, NameCache, InteropLibrary)}
             *     Activation probability: 0.25000
             *     With/without class size: 7/0 bytes
             * 
*/ @Override public boolean isMemberReadable(Object arg0Value_, String arg1Value) { assert arg0Value_ instanceof HostAdapterSuperMembers : "Invalid library usage. Library does not accept given receiver."; assert assertAdopted(); HostAdapterSuperMembers arg0Value = ((HostAdapterSuperMembers) arg0Value_); int state_0 = this.state_0_; if ((state_0 & 0b100) != 0 /* is SpecializationActive[HostAdapterSuperMembers.isMemberReadable(HostAdapterSuperMembers, String, NameCache, InteropLibrary)] */) { { NameCache cache_ = this.cache; if (cache_ != null) { InteropLibrary interop__ = this.receiverAdapterInteropLibrary_; return arg0Value.isMemberReadable(arg1Value, cache_, interop__); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return isMemberReadableNode_AndSpecialize(arg0Value, arg1Value); } private boolean isMemberReadableNode_AndSpecialize(HostAdapterSuperMembers arg0Value, String arg1Value) { int state_0 = this.state_0_; { InteropLibrary interop__ = null; NameCache cache_; NameCache cache__shared = this.cache; if (cache__shared != null) { cache_ = cache__shared; } else { cache_ = (NameCache.create()); if (cache_ == null) { throw new IllegalStateException("Specialization 'isMemberReadable(HostAdapterSuperMembers, String, NameCache, InteropLibrary)' contains a shared cache with name 'cache' that returned a default value for the cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state."); } } if (this.cache == null) { VarHandle.storeStoreFence(); this.cache = cache_; } interop__ = this.receiverAdapterInteropLibrary_; state_0 = state_0 | 0b100 /* add SpecializationActive[HostAdapterSuperMembers.isMemberReadable(HostAdapterSuperMembers, String, NameCache, InteropLibrary)] */; this.state_0_ = state_0; return arg0Value.isMemberReadable(arg1Value, cache_, interop__); } } /** * Debug Info:
             *   Specialization {@link HostAdapterSuperMembers#isMemberInvocable(HostAdapterSuperMembers, String, NameCache, InteropLibrary)}
             *     Activation probability: 0.25000
             *     With/without class size: 7/0 bytes
             * 
*/ @Override public boolean isMemberInvocable(Object arg0Value_, String arg1Value) { assert arg0Value_ instanceof HostAdapterSuperMembers : "Invalid library usage. Library does not accept given receiver."; assert assertAdopted(); HostAdapterSuperMembers arg0Value = ((HostAdapterSuperMembers) arg0Value_); int state_0 = this.state_0_; if ((state_0 & 0b1000) != 0 /* is SpecializationActive[HostAdapterSuperMembers.isMemberInvocable(HostAdapterSuperMembers, String, NameCache, InteropLibrary)] */) { { NameCache cache_ = this.cache; if (cache_ != null) { InteropLibrary interop__ = this.receiverAdapterInteropLibrary_; return arg0Value.isMemberInvocable(arg1Value, cache_, interop__); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return isMemberInvocableNode_AndSpecialize(arg0Value, arg1Value); } private boolean isMemberInvocableNode_AndSpecialize(HostAdapterSuperMembers arg0Value, String arg1Value) { int state_0 = this.state_0_; { InteropLibrary interop__ = null; NameCache cache_; NameCache cache__shared = this.cache; if (cache__shared != null) { cache_ = cache__shared; } else { cache_ = (NameCache.create()); if (cache_ == null) { throw new IllegalStateException("Specialization 'isMemberInvocable(HostAdapterSuperMembers, String, NameCache, InteropLibrary)' contains a shared cache with name 'cache' that returned a default value for the cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state."); } } if (this.cache == null) { VarHandle.storeStoreFence(); this.cache = cache_; } interop__ = this.receiverAdapterInteropLibrary_; state_0 = state_0 | 0b1000 /* add SpecializationActive[HostAdapterSuperMembers.isMemberInvocable(HostAdapterSuperMembers, String, NameCache, InteropLibrary)] */; this.state_0_ = state_0; return arg0Value.isMemberInvocable(arg1Value, cache_, interop__); } } @Override public Object getMembers(Object receiver, boolean includeInternal) throws UnsupportedMessageException { assert receiver instanceof HostAdapterSuperMembers : "Invalid library usage. Library does not accept given receiver."; assert assertAdopted(); return (((HostAdapterSuperMembers) receiver)).getMembers(includeInternal); } } @GeneratedBy(HostAdapterSuperMembers.class) @DenyReplace private static final class Uncached extends InteropLibrary { protected Uncached() { } @Override @TruffleBoundary public boolean accepts(Object receiver) { assert !(receiver instanceof HostAdapterSuperMembers) || DYNAMIC_DISPATCH_LIBRARY_.getUncached().dispatch(receiver) == null : "Invalid library export. Exported receiver with dynamic dispatch found but not expected."; return receiver instanceof HostAdapterSuperMembers; } @Override public boolean isAdoptable() { return false; } @Override public NodeCost getCost() { return NodeCost.MEGAMORPHIC; } @TruffleBoundary @Override public boolean hasMembers(Object receiver) { // declared: true assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver."; return ((HostAdapterSuperMembers) receiver) .hasMembers(); } @TruffleBoundary @Override public Object readMember(Object arg0Value_, String arg1Value) throws UnsupportedMessageException, UnknownIdentifierException { // declared: true assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver."; HostAdapterSuperMembers arg0Value = ((HostAdapterSuperMembers) arg0Value_); return arg0Value.readMember(arg1Value, (NameCache.getUncached()), INTEROP_LIBRARY_.getUncached((arg0Value.adapter))); } @TruffleBoundary @Override public Object invokeMember(Object arg0Value_, String arg1Value, Object... arg2Value) throws UnsupportedMessageException, ArityException, UnknownIdentifierException, UnsupportedTypeException { // declared: true assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver."; HostAdapterSuperMembers arg0Value = ((HostAdapterSuperMembers) arg0Value_); return arg0Value.invokeMember(arg1Value, arg2Value, (NameCache.getUncached()), INTEROP_LIBRARY_.getUncached((arg0Value.adapter))); } @TruffleBoundary @Override public boolean isMemberReadable(Object arg0Value_, String arg1Value) { // declared: true assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver."; HostAdapterSuperMembers arg0Value = ((HostAdapterSuperMembers) arg0Value_); return arg0Value.isMemberReadable(arg1Value, (NameCache.getUncached()), INTEROP_LIBRARY_.getUncached((arg0Value.adapter))); } @TruffleBoundary @Override public boolean isMemberInvocable(Object arg0Value_, String arg1Value) { // declared: true assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver."; HostAdapterSuperMembers arg0Value = ((HostAdapterSuperMembers) arg0Value_); return arg0Value.isMemberInvocable(arg1Value, (NameCache.getUncached()), INTEROP_LIBRARY_.getUncached((arg0Value.adapter))); } @TruffleBoundary @Override public Object getMembers(Object receiver, boolean includeInternal) throws UnsupportedMessageException { // declared: true assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver."; return ((HostAdapterSuperMembers) receiver) .getMembers(includeInternal); } } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy