Class JSArrayObject

All Implemented Interfaces:
com.oracle.truffle.api.interop.TruffleObject, JSCopyableObject

public final class JSArrayObject extends JSArrayBase implements JSCopyableObject
  • Constructor Details

  • Method Details

    • create

      public static JSArrayObject create(com.oracle.truffle.api.object.Shape shape, JSDynamicObject proto, DynamicArray arrayType, Object array, ArrayAllocationSite site, long length, int usedLength, int indexOffset, int arrayOffset, int holeCount)
    • createEmpty

      public static JSArrayObject createEmpty(com.oracle.truffle.api.object.Shape shape, JSDynamicObject proto, DynamicArray arrayType)
    • copyWithoutProperties

      protected JSObject copyWithoutProperties(com.oracle.truffle.api.object.Shape shape)
      Overrides:
      copyWithoutProperties in class JSObject
    • getClassName

      public com.oracle.truffle.api.strings.TruffleString getClassName()
      Description copied from class: JSDynamicObject
      The [[Class]] internal property. For ES5, this is the second part of what Object.prototype.toString.call(myObj) returns, e.g. "[object Array]".
      Overrides:
      getClassName in class JSNonProxyObject
    • getBuiltinToStringTag

      public com.oracle.truffle.api.strings.TruffleString getBuiltinToStringTag()
      Description copied from class: JSObject
      Returns builtinTag as per Object.prototype.toString(). By default returns "Object".
      Overrides:
      getBuiltinToStringTag in class JSObject
      Returns:
      built-in toStringTag
    • hasArrayElements

      public boolean hasArrayElements()
    • getArraySize

      public long getArraySize()
    • readArrayElement

      public Object readArrayElement(long index, com.oracle.truffle.api.interop.InteropLibrary self, ReadElementNode readNode, ExportValueNode exportNode) throws com.oracle.truffle.api.interop.InvalidArrayIndexException, com.oracle.truffle.api.interop.UnsupportedMessageException
      Throws:
      com.oracle.truffle.api.interop.InvalidArrayIndexException
      com.oracle.truffle.api.interop.UnsupportedMessageException
    • isArrayElementReadable

      public boolean isArrayElementReadable(long index, com.oracle.truffle.api.interop.InteropLibrary thisLibrary)
    • writeArrayElement

      public void writeArrayElement(long index, Object value, ArrayElementInfoNode elements, ImportValueNode castValueNode, WriteElementNode writeNode) throws com.oracle.truffle.api.interop.InvalidArrayIndexException, com.oracle.truffle.api.interop.UnsupportedMessageException
      Throws:
      com.oracle.truffle.api.interop.InvalidArrayIndexException
      com.oracle.truffle.api.interop.UnsupportedMessageException
    • isArrayElementModifiable

      public boolean isArrayElementModifiable(long index, ArrayElementInfoNode elements)
    • isArrayElementInsertable

      public boolean isArrayElementInsertable(long index, ArrayElementInfoNode elements)
    • isArrayElementRemovable

      public boolean isArrayElementRemovable(long index, ArrayElementInfoNode elements)
    • removeArrayElement

      public void removeArrayElement(long index, ArrayElementInfoNode elements) throws com.oracle.truffle.api.interop.UnsupportedMessageException, com.oracle.truffle.api.interop.InvalidArrayIndexException
      Throws:
      com.oracle.truffle.api.interop.UnsupportedMessageException
      com.oracle.truffle.api.interop.InvalidArrayIndexException
    • toDisplayStringImpl

      public com.oracle.truffle.api.strings.TruffleString toDisplayStringImpl(boolean allowSideEffects, ToDisplayStringFormat format, int depth)
      Description copied from class: JSDynamicObject
      A more informative toString variant, mainly used for error messages.
      Overrides:
      toDisplayStringImpl in class JSNonProxyObject
      Parameters:
      format - formatting parameters
      depth - current nesting depth