Class ToArrayIndexNode

java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.js.nodes.JavaScriptBaseNode
com.oracle.truffle.js.nodes.cast.ToArrayIndexNode
All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface, Cloneable

public abstract class ToArrayIndexNode extends JavaScriptBaseNode
Converts value to array index (0 invalid input: '<'= x invalid input: '<' 2^32-1) or ToPropertyKey.
  • Field Details

    • convertStringToIndex

      protected final boolean convertStringToIndex
  • Constructor Details

    • ToArrayIndexNode

      protected ToArrayIndexNode(boolean convertStringToIndex)
  • Method Details

    • execute

      public abstract Object execute(Object value)
    • executeLong

      public abstract long executeLong(Object operand) throws com.oracle.truffle.api.nodes.UnexpectedResultException
      Throws:
      com.oracle.truffle.api.nodes.UnexpectedResultException
    • create

      public static ToArrayIndexNode create()
    • createNoStringToIndex

      public static ToArrayIndexNode createNoStringToIndex()
    • doInteger

      protected static long doInteger(int value)
    • doLong

      protected static long doLong(long value)
    • doubleIsIntIndex

      protected static boolean doubleIsIntIndex(double d)
    • doDoubleAsIntIndex

      protected static long doDoubleAsIntIndex(double value)
    • doubleIsUintIndex

      protected static boolean doubleIsUintIndex(double d)
    • doDoubleAsUintIndex

      protected static long doDoubleAsUintIndex(double value)
    • doSymbol

      protected static Symbol doSymbol(Symbol value)
    • doBigInt

      protected static long doBigInt(BigInt value)
    • convertFromString

      protected final Object convertFromString(com.oracle.truffle.api.strings.TruffleString index, com.oracle.truffle.api.profiles.InlinedConditionProfile startsWithDigitBranch, com.oracle.truffle.api.profiles.InlinedBranchProfile isArrayIndexBranch, com.oracle.truffle.api.strings.TruffleString.ReadCharUTF16Node stringReadNode)
    • convertFromStringNotInRange

      protected static com.oracle.truffle.api.strings.TruffleString convertFromStringNotInRange(com.oracle.truffle.api.strings.TruffleString index)
    • notArrayIndex

      protected static boolean notArrayIndex(Object o)
    • doInteropArrayIndex

      protected static long doInteropArrayIndex(Object value, com.oracle.truffle.api.interop.InteropLibrary interop, long index)
    • doNonArrayIndex

      protected final Object doNonArrayIndex(Object value, com.oracle.truffle.api.nodes.Node node, com.oracle.truffle.api.interop.InteropLibrary interop, JSToPropertyKeyNode toPropertyKey, ToArrayIndexNoToPropertyKeyNode propertyKeyToArrayIndex)