Class JSToIntegerWithTruncationNode

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

public abstract class JSToIntegerWithTruncationNode extends JavaScriptBaseNode
This implements ToIntegerWithTruncation (via Temporal proposal).
  • Constructor Details

    • JSToIntegerWithTruncationNode

      public JSToIntegerWithTruncationNode()
  • Method Details

    • execute

      public abstract Object execute(Object value)
    • executeIntOrThrow

      public final int executeIntOrThrow(Object value)
      The node by definition should return a double value (that has integer properties), but in some cases we know that the result needs to fit into an integer. Methods like https://tc39.es/proposal-temporal/#sec-temporal-isodatetimewithinlimits or https://tc39.es/proposal-temporal/#sec-temporal-isoyearmonthwithinlimits ensure that days and months are in valid ranges, and years up to about 273,000 years.
    • executeDouble

      public final double executeDouble(Object value)
    • create

      public static JSToIntegerWithTruncationNode create()
    • doInteger

      protected static int doInteger(int value)
    • doLong

      protected static long doLong(long value)
    • doBoolean

      protected static int doBoolean(boolean value)
    • doSafeInteger

      protected static SafeInteger doSafeInteger(SafeInteger value)
    • doDouble

      protected double doDouble(double value)
    • doNull

      protected static int doNull(Object value)
    • doUndefined

      protected static int doUndefined(Object value)
    • doSymbol

      protected final Number doSymbol(Symbol value)
    • doBigInt

      protected final Number doBigInt(BigInt value)
    • doString

      protected Number doString(com.oracle.truffle.api.strings.TruffleString value, JSToIntegerWithTruncationNode toIntegerWithTruncation, JSStringToNumberNode stringToNumberNode)
    • doJSOrForeignObject

      protected Number doJSOrForeignObject(Object value, JSToIntegerWithTruncationNode toIntegerWithTruncation, JSToNumberNode toNumberNode)