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

com.oracle.truffle.js.runtime.builtins.JSArgumentsObjectGen Maven / Gradle / Ivy

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

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.CompilationFinal;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.GeneratedBy;
import com.oracle.truffle.api.dsl.DSLSupport.SpecializationDataNode;
import com.oracle.truffle.api.interop.InteropLibrary;
import com.oracle.truffle.api.interop.InvalidArrayIndexException;
import com.oracle.truffle.api.interop.UnsupportedMessageException;
import com.oracle.truffle.api.interop.UnsupportedTypeException;
import com.oracle.truffle.api.library.LibraryExport;
import com.oracle.truffle.api.nodes.DenyReplace;
import com.oracle.truffle.api.nodes.Node;
import com.oracle.truffle.api.strings.TruffleString.FromJavaStringNode;
import com.oracle.truffle.js.nodes.access.ReadElementNode;
import com.oracle.truffle.js.nodes.access.WriteElementNode;
import com.oracle.truffle.js.nodes.interop.ArrayElementInfoNode;
import com.oracle.truffle.js.nodes.interop.ArrayElementInfoNodeGen;
import com.oracle.truffle.js.nodes.interop.ExportValueNode;
import com.oracle.truffle.js.nodes.interop.ImportValueNode;
import com.oracle.truffle.js.nodes.interop.JSInteropGetIteratorNode;
import com.oracle.truffle.js.nodes.interop.KeyInfoNode;
import com.oracle.truffle.js.runtime.objects.JSNonProxyObjectGen;
import com.oracle.truffle.js.runtime.objects.JSObject;
import java.lang.invoke.VarHandle;
import java.util.Objects;

@GeneratedBy(JSArgumentsObject.class)
@SuppressWarnings("javadoc")
public final class JSArgumentsObjectGen {

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

    private JSArgumentsObjectGen() {
    }

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

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

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

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

        @GeneratedBy(JSArgumentsObject.class)
        public static class Cached extends JSNonProxyObjectGen.InteropLibraryExports.Cached {

            /**
             * State Info: 
             *   0: SpecializationActive {@link JSArgumentsObject#readArrayElement(JSArgumentsObject, long, InteropLibrary, ReadElementNode, ExportValueNode)}
             *   1: SpecializationActive {@link JSArgumentsObject#writeArrayElement(JSArgumentsObject, long, Object, ArrayElementInfoNode, ImportValueNode, WriteElementNode)}
             *   2: SpecializationActive {@link JSArgumentsObject#isArrayElementModifiable(JSArgumentsObject, long, ArrayElementInfoNode)}
             *   3: SpecializationActive {@link JSArgumentsObject#isArrayElementInsertable(JSArgumentsObject, long, ArrayElementInfoNode)}
             * 
*/ @CompilationFinal private int state_0_; /** * Source Info:
             *   Specialization: {@link JSObject#readMember}
             *   Parameter: {@link FromJavaStringNode} fromJavaString
*/ @Child private FromJavaStringNode fromJavaString; /** * Source Info:
             *   Specialization: {@link JSObject#isMemberReadable}
             *   Parameter: {@link KeyInfoNode} keyInfo
*/ @Child private KeyInfoNode keyInfo; /** * Source Info:
             *   Specialization: {@link JSObject#hasIterator}
             *   Parameter: {@link JSInteropGetIteratorNode} getIteratorNode
*/ @Child private JSInteropGetIteratorNode getIteratorNode; /** * Source Info:
             *   Specialization: {@link JSArgumentsObject#writeArrayElement}
             *   Parameter: {@link ArrayElementInfoNode} elements
*/ @Child private ArrayElementInfoNode elements; @Child private ReadArrayElementNode_ReadArrayElementData readArrayElementNode__readArrayElement_cache; @Child private WriteArrayElementNode_WriteArrayElementData writeArrayElementNode__writeArrayElement_cache; protected Cached(Object receiver) { super(receiver); } @Override public Object getMembers(Object receiver, boolean includeInternal) throws UnsupportedMessageException { assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver."; assert assertAdopted(); return (((JSArgumentsObject) receiver)).getMembers(includeInternal); } @Override public boolean hasArrayElements(Object receiver) { assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver."; assert assertAdopted(); return (((JSArgumentsObject) receiver)).hasArrayElements(); } @Override public long getArraySize(Object receiver) throws UnsupportedMessageException { assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver."; assert assertAdopted(); return (((JSArgumentsObject) receiver)).getArraySize(); } /** * Debug Info:
             *   Specialization {@link JSArgumentsObject#readArrayElement(JSArgumentsObject, long, InteropLibrary, ReadElementNode, ExportValueNode)}
             *     Activation probability: 0.05263
             *     With/without class size: 5/8 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."; assert assertAdopted(); JSArgumentsObject arg0Value = ((JSArgumentsObject) arg0Value_); int state_0 = this.state_0_; if ((state_0 & 0b1) != 0 /* is SpecializationActive[JSArgumentsObject.readArrayElement(JSArgumentsObject, long, InteropLibrary, ReadElementNode, ExportValueNode)] */) { ReadArrayElementNode_ReadArrayElementData s0_ = this.readArrayElementNode__readArrayElement_cache; if (s0_ != null) { { InteropLibrary self__ = (this); return arg0Value.readArrayElement(arg1Value, self__, s0_.readNode_, s0_.exportNode_); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return readArrayElementNode_AndSpecialize(arg0Value, arg1Value); } private Object readArrayElementNode_AndSpecialize(JSArgumentsObject arg0Value, long arg1Value) throws InvalidArrayIndexException, UnsupportedMessageException { int state_0 = this.state_0_; { InteropLibrary self__ = null; ReadArrayElementNode_ReadArrayElementData s0_ = this.insert(new ReadArrayElementNode_ReadArrayElementData()); self__ = (this); ReadElementNode readNode__ = s0_.insert((ReadElementNode.create(JSObject.language(self__).getJSContext()))); Objects.requireNonNull(readNode__, "A specialization cache returned a default value. The cache initializer must never return a default value for this cache. Use @Cached(neverDefault=false) to allow default values for this cached value or make sure the cache initializer never returns the default value."); s0_.readNode_ = readNode__; ExportValueNode exportNode__ = s0_.insert((ExportValueNode.create())); Objects.requireNonNull(exportNode__, "A specialization cache returned a default value. The cache initializer must never return a default value for this cache. Use @Cached(neverDefault=false) to allow default values for this cached value or make sure the cache initializer never returns the default value."); s0_.exportNode_ = exportNode__; VarHandle.storeStoreFence(); this.readArrayElementNode__readArrayElement_cache = s0_; state_0 = state_0 | 0b1 /* add SpecializationActive[JSArgumentsObject.readArrayElement(JSArgumentsObject, long, InteropLibrary, ReadElementNode, ExportValueNode)] */; this.state_0_ = state_0; return arg0Value.readArrayElement(arg1Value, self__, readNode__, exportNode__); } } /** * Debug Info:
             *   Specialization {@link JSArgumentsObject#isArrayElementReadable(JSArgumentsObject, long, InteropLibrary)}
             *     Activation probability: 0.05263
             *     With/without class size: 4/0 bytes
             * 
*/ @Override public boolean isArrayElementReadable(Object arg0Value_, long arg1Value) { assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver."; assert assertAdopted(); JSArgumentsObject arg0Value = ((JSArgumentsObject) arg0Value_); { InteropLibrary thisLibrary__ = (this); return arg0Value.isArrayElementReadable(arg1Value, thisLibrary__); } } /** * Debug Info:
             *   Specialization {@link JSArgumentsObject#writeArrayElement(JSArgumentsObject, long, Object, ArrayElementInfoNode, ImportValueNode, WriteElementNode)}
             *     Activation probability: 0.05263
             *     With/without class size: 5/8 bytes
             * 
*/ @Override public void writeArrayElement(Object arg0Value_, long arg1Value, Object arg2Value) throws UnsupportedMessageException, UnsupportedTypeException, InvalidArrayIndexException { assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver."; assert assertAdopted(); JSArgumentsObject arg0Value = ((JSArgumentsObject) arg0Value_); int state_0 = this.state_0_; if ((state_0 & 0b10) != 0 /* is SpecializationActive[JSArgumentsObject.writeArrayElement(JSArgumentsObject, long, Object, ArrayElementInfoNode, ImportValueNode, WriteElementNode)] */) { WriteArrayElementNode_WriteArrayElementData s0_ = this.writeArrayElementNode__writeArrayElement_cache; if (s0_ != null) { { ArrayElementInfoNode elements_ = this.elements; if (elements_ != null) { arg0Value.writeArrayElement(arg1Value, arg2Value, elements_, s0_.castValueNode_, s0_.writeNode_); return; } } } } CompilerDirectives.transferToInterpreterAndInvalidate(); writeArrayElementNode_AndSpecialize(arg0Value, arg1Value, arg2Value); return; } private void writeArrayElementNode_AndSpecialize(JSArgumentsObject arg0Value, long arg1Value, Object arg2Value) throws InvalidArrayIndexException, UnsupportedMessageException { int state_0 = this.state_0_; WriteArrayElementNode_WriteArrayElementData s0_ = this.insert(new WriteArrayElementNode_WriteArrayElementData()); ArrayElementInfoNode elements_; ArrayElementInfoNode elements__shared = this.elements; if (elements__shared != null) { elements_ = elements__shared; } else { elements_ = s0_.insert((ArrayElementInfoNodeGen.create())); if (elements_ == null) { throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state."); } } if (this.elements == null) { this.elements = elements_; } ImportValueNode castValueNode__ = s0_.insert((ImportValueNode.create())); Objects.requireNonNull(castValueNode__, "A specialization cache returned a default value. The cache initializer must never return a default value for this cache. Use @Cached(neverDefault=false) to allow default values for this cached value or make sure the cache initializer never returns the default value."); s0_.castValueNode_ = castValueNode__; WriteElementNode writeNode__ = s0_.insert((WriteElementNode.createCachedInterop())); Objects.requireNonNull(writeNode__, "A specialization cache returned a default value. The cache initializer must never return a default value for this cache. Use @Cached(neverDefault=false) to allow default values for this cached value or make sure the cache initializer never returns the default value."); s0_.writeNode_ = writeNode__; VarHandle.storeStoreFence(); this.writeArrayElementNode__writeArrayElement_cache = s0_; state_0 = state_0 | 0b10 /* add SpecializationActive[JSArgumentsObject.writeArrayElement(JSArgumentsObject, long, Object, ArrayElementInfoNode, ImportValueNode, WriteElementNode)] */; this.state_0_ = state_0; arg0Value.writeArrayElement(arg1Value, arg2Value, elements_, castValueNode__, writeNode__); return; } /** * Debug Info:
             *   Specialization {@link JSArgumentsObject#isArrayElementModifiable(JSArgumentsObject, long, ArrayElementInfoNode)}
             *     Activation probability: 0.05263
             *     With/without class size: 4/0 bytes
             * 
*/ @Override public boolean isArrayElementModifiable(Object arg0Value_, long arg1Value) { assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver."; assert assertAdopted(); JSArgumentsObject arg0Value = ((JSArgumentsObject) arg0Value_); int state_0 = this.state_0_; if ((state_0 & 0b100) != 0 /* is SpecializationActive[JSArgumentsObject.isArrayElementModifiable(JSArgumentsObject, long, ArrayElementInfoNode)] */) { { ArrayElementInfoNode elements_ = this.elements; if (elements_ != null) { return arg0Value.isArrayElementModifiable(arg1Value, elements_); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return isArrayElementModifiableNode_AndSpecialize(arg0Value, arg1Value); } private boolean isArrayElementModifiableNode_AndSpecialize(JSArgumentsObject arg0Value, long arg1Value) { int state_0 = this.state_0_; ArrayElementInfoNode elements_; ArrayElementInfoNode elements__shared = this.elements; if (elements__shared != null) { elements_ = elements__shared; } else { elements_ = this.insert((ArrayElementInfoNodeGen.create())); if (elements_ == null) { throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state."); } } if (this.elements == null) { VarHandle.storeStoreFence(); this.elements = elements_; } state_0 = state_0 | 0b100 /* add SpecializationActive[JSArgumentsObject.isArrayElementModifiable(JSArgumentsObject, long, ArrayElementInfoNode)] */; this.state_0_ = state_0; return arg0Value.isArrayElementModifiable(arg1Value, elements_); } /** * Debug Info:
             *   Specialization {@link JSArgumentsObject#isArrayElementInsertable(JSArgumentsObject, long, ArrayElementInfoNode)}
             *     Activation probability: 0.05263
             *     With/without class size: 4/0 bytes
             * 
*/ @Override public boolean isArrayElementInsertable(Object arg0Value_, long arg1Value) { assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver."; assert assertAdopted(); JSArgumentsObject arg0Value = ((JSArgumentsObject) arg0Value_); int state_0 = this.state_0_; if ((state_0 & 0b1000) != 0 /* is SpecializationActive[JSArgumentsObject.isArrayElementInsertable(JSArgumentsObject, long, ArrayElementInfoNode)] */) { { ArrayElementInfoNode elements_ = this.elements; if (elements_ != null) { return arg0Value.isArrayElementInsertable(arg1Value, elements_); } } } CompilerDirectives.transferToInterpreterAndInvalidate(); return isArrayElementInsertableNode_AndSpecialize(arg0Value, arg1Value); } private boolean isArrayElementInsertableNode_AndSpecialize(JSArgumentsObject arg0Value, long arg1Value) { int state_0 = this.state_0_; ArrayElementInfoNode elements_; ArrayElementInfoNode elements__shared = this.elements; if (elements__shared != null) { elements_ = elements__shared; } else { elements_ = this.insert((ArrayElementInfoNodeGen.create())); if (elements_ == null) { throw new IllegalStateException("A specialization returned a default value for a cached initializer. Default values are not supported for shared cached initializers because the default value is reserved for the uninitialized state."); } } if (this.elements == null) { VarHandle.storeStoreFence(); this.elements = elements_; } state_0 = state_0 | 0b1000 /* add SpecializationActive[JSArgumentsObject.isArrayElementInsertable(JSArgumentsObject, long, ArrayElementInfoNode)] */; this.state_0_ = state_0; return arg0Value.isArrayElementInsertable(arg1Value, elements_); } @GeneratedBy(JSArgumentsObject.class) @DenyReplace private static final class ReadArrayElementNode_ReadArrayElementData extends Node implements SpecializationDataNode { /** * Source Info:
                 *   Specialization: {@link JSArgumentsObject#readArrayElement(JSArgumentsObject, long, InteropLibrary, ReadElementNode, ExportValueNode)}
                 *   Parameter: {@link ReadElementNode} readNode
*/ @Child ReadElementNode readNode_; /** * Source Info:
                 *   Specialization: {@link JSArgumentsObject#readArrayElement(JSArgumentsObject, long, InteropLibrary, ReadElementNode, ExportValueNode)}
                 *   Parameter: {@link ExportValueNode} exportNode
*/ @Child ExportValueNode exportNode_; ReadArrayElementNode_ReadArrayElementData() { } } @GeneratedBy(JSArgumentsObject.class) @DenyReplace private static final class WriteArrayElementNode_WriteArrayElementData extends Node implements SpecializationDataNode { /** * Source Info:
                 *   Specialization: {@link JSArgumentsObject#writeArrayElement(JSArgumentsObject, long, Object, ArrayElementInfoNode, ImportValueNode, WriteElementNode)}
                 *   Parameter: {@link ImportValueNode} castValueNode
*/ @Child ImportValueNode castValueNode_; /** * Source Info:
                 *   Specialization: {@link JSArgumentsObject#writeArrayElement(JSArgumentsObject, long, Object, ArrayElementInfoNode, ImportValueNode, WriteElementNode)}
                 *   Parameter: {@link WriteElementNode} writeNode
*/ @Child WriteElementNode writeNode_; WriteArrayElementNode_WriteArrayElementData() { } } } @GeneratedBy(JSArgumentsObject.class) public static class Uncached extends JSNonProxyObjectGen.InteropLibraryExports.Uncached { protected Uncached(Object receiver) { super(receiver); } @Override @TruffleBoundary public boolean accepts(Object receiver) { return super.accepts(receiver); } @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 ((JSArgumentsObject) receiver) .getMembers(includeInternal); } @TruffleBoundary @Override public boolean hasArrayElements(Object receiver) { // declared: true assert this.accepts(receiver) : "Invalid library usage. Library does not accept given receiver."; return ((JSArgumentsObject) 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 ((JSArgumentsObject) receiver) .getArraySize(); } @TruffleBoundary @Override public Object readArrayElement(Object arg0Value_, long arg1Value) throws InvalidArrayIndexException, UnsupportedMessageException { // declared: true assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver."; JSArgumentsObject arg0Value = ((JSArgumentsObject) arg0Value_); return arg0Value.readArrayElement(arg1Value, (this), (JSObject.getUncachedRead()), (ExportValueNode.getUncached())); } @TruffleBoundary @Override public boolean isArrayElementReadable(Object arg0Value_, long arg1Value) { // declared: true assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver."; JSArgumentsObject arg0Value = ((JSArgumentsObject) arg0Value_); return arg0Value.isArrayElementReadable(arg1Value, (this)); } @TruffleBoundary @Override public void writeArrayElement(Object arg0Value_, long arg1Value, Object arg2Value) throws InvalidArrayIndexException, UnsupportedMessageException, UnsupportedTypeException { // declared: true assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver."; JSArgumentsObject arg0Value = ((JSArgumentsObject) arg0Value_); arg0Value.writeArrayElement(arg1Value, arg2Value, (ArrayElementInfoNodeGen.getUncached()), (ImportValueNode.getUncached()), (JSObject.getUncachedWrite())); return; } @TruffleBoundary @Override public boolean isArrayElementModifiable(Object arg0Value_, long arg1Value) { // declared: true assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver."; JSArgumentsObject arg0Value = ((JSArgumentsObject) arg0Value_); return arg0Value.isArrayElementModifiable(arg1Value, (ArrayElementInfoNodeGen.getUncached())); } @TruffleBoundary @Override public boolean isArrayElementInsertable(Object arg0Value_, long arg1Value) { // declared: true assert this.accepts(arg0Value_) : "Invalid library usage. Library does not accept given receiver."; JSArgumentsObject arg0Value = ((JSArgumentsObject) arg0Value_); return arg0Value.isArrayElementInsertable(arg1Value, (ArrayElementInfoNodeGen.getUncached())); } } } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy