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

org.pkl.thirdparty.truffle.host.KeysArrayGen 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.CompilationFinal;
import org.pkl.thirdparty.truffle.api.CompilerDirectives.TruffleBoundary;
import org.pkl.thirdparty.truffle.api.dsl.GeneratedBy;
import org.pkl.thirdparty.truffle.api.dsl.InlineSupport.InlineTarget;
import org.pkl.thirdparty.truffle.api.dsl.InlineSupport.StateField;
import org.pkl.thirdparty.truffle.api.dsl.InlineSupport.UnsafeAccessedField;
import org.pkl.thirdparty.truffle.api.interop.InteropLibrary;
import org.pkl.thirdparty.truffle.api.interop.InvalidArrayIndexException;
import org.pkl.thirdparty.truffle.api.interop.UnsupportedMessageException;
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.Node;
import org.pkl.thirdparty.truffle.api.nodes.NodeCost;
import org.pkl.thirdparty.truffle.api.profiles.InlinedBranchProfile;
import org.pkl.thirdparty.truffle.host.HostObject.KeysArray;
import java.lang.invoke.MethodHandles;

@GeneratedBy(KeysArray.class)
@SuppressWarnings("javadoc")
final class KeysArrayGen {

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

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

    private KeysArrayGen() {
    }

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

        private static final Uncached UNCACHED = new Uncached();
        private static final Cached CACHE = new Cached();

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

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

        @Override
        protected InteropLibrary createCached(Object receiver) {
            assert receiver instanceof KeysArray;
            return InteropLibraryExports.CACHE;
        }

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

            private static final StateField STATE_0_UPDATER = StateField.create(MethodHandles.lookup(), "state_0_");
            /**
             * Source Info: 
             *   Specialization: {@link KeysArray#readArrayElement(KeysArray, long, Node, InlinedBranchProfile)}
             *   Parameter: {@link InlinedBranchProfile} error
             *   Inline method: {@link InlinedBranchProfile#inline}
*/ private static final InlinedBranchProfile INLINED_ERROR_ = InlinedBranchProfile.inline(InlineTarget.create(InlinedBranchProfile.class, STATE_0_UPDATER.subUpdater(0, 1))); /** * State Info:
             *   0: InlinedCache
             *        Specialization: {@link KeysArray#readArrayElement}
             *        Parameter: {@link InlinedBranchProfile} error
             *        Inline method: {@link InlinedBranchProfile#inline}
             * 
*/ @CompilationFinal @UnsafeAccessedField private int state_0_; protected Cached() { } @Override public boolean accepts(Object receiver) { assert !(receiver instanceof KeysArray) || DYNAMIC_DISPATCH_LIBRARY_.getUncached().dispatch(receiver) == null : "Invalid library export. Exported receiver with dynamic dispatch found but not expected."; return receiver instanceof KeysArray; } @Override public boolean isAdoptable() { return false; } @Override public boolean hasArrayElements(Object receiver) { assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver."; return (((KeysArray) receiver)).hasArrayElements(); } @Override public long getArraySize(Object receiver) throws UnsupportedMessageException { assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver."; return (((KeysArray) receiver)).getArraySize(); } @Override public boolean isArrayElementReadable(Object receiver, long index) { assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver."; return (((KeysArray) receiver)).isArrayElementReadable(index); } /** * Debug Info:
             *   Specialization {@link KeysArray#readArrayElement(KeysArray, long, Node, InlinedBranchProfile)}
             *     Activation probability: 1.00000
             *     With/without class size: 24/1 bytes
             * 
*/ @Override public Object readArrayElement(Object arg0Value_, long arg1Value) throws UnsupportedMessageException, InvalidArrayIndexException { assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver."; KeysArray arg0Value = ((KeysArray) arg0Value_); { Node node__ = (this); return arg0Value.readArrayElement(arg1Value, node__, INLINED_ERROR_); } } @Override public NodeCost getCost() { return NodeCost.MONOMORPHIC; } } @GeneratedBy(KeysArray.class) @DenyReplace private static final class Uncached extends InteropLibrary { protected Uncached() { } @Override @TruffleBoundary public boolean accepts(Object receiver) { assert !(receiver instanceof KeysArray) || DYNAMIC_DISPATCH_LIBRARY_.getUncached().dispatch(receiver) == null : "Invalid library export. Exported receiver with dynamic dispatch found but not expected."; return receiver instanceof KeysArray; } @Override public boolean isAdoptable() { return false; } @Override public NodeCost getCost() { return NodeCost.MEGAMORPHIC; } @TruffleBoundary @Override public boolean hasArrayElements(Object receiver) { // declared: true assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver."; return ((KeysArray) receiver) .hasArrayElements(); } @TruffleBoundary @Override public long getArraySize(Object receiver) throws UnsupportedMessageException { // declared: true assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver."; return ((KeysArray) receiver) .getArraySize(); } @TruffleBoundary @Override public boolean isArrayElementReadable(Object receiver, long index) { // declared: true assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver."; return ((KeysArray) receiver) .isArrayElementReadable(index); } @TruffleBoundary @Override public Object readArrayElement(Object arg0Value_, long arg1Value) throws InvalidArrayIndexException { // declared: true assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver."; KeysArray arg0Value = ((KeysArray) arg0Value_); return arg0Value.readArrayElement(arg1Value, (this), (InlinedBranchProfile.getUncached())); } } } }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy