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
This implements ToIntegerWithTruncation (via Temporal proposal).
-
Nested Class Summary
Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.nodes.Node.Child, com.oracle.truffle.api.nodes.Node.Children -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreate()protected final Numberprotected static intdoBoolean(boolean value) protected doubledoDouble(double value) protected static intdoInteger(int value) protected NumberdoJSOrForeignObject(Object value, JSToIntegerWithTruncationNode toIntegerWithTruncation, JSToNumberNode toNumberNode) protected static longdoLong(long value) protected static intprotected static SafeIntegerdoSafeInteger(SafeInteger value) protected NumberdoString(com.oracle.truffle.api.strings.TruffleString value, JSToIntegerWithTruncationNode toIntegerWithTruncation, JSStringToNumberNode stringToNumberNode) protected final Numberprotected static intdoUndefined(Object value) abstract Objectfinal doubleexecuteDouble(Object value) final intexecuteIntOrThrow(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 inherited from class JavaScriptBaseNode
copy, getJSContext, getLanguage, getLanguageOptions, getRealm, hasOverloadedOperators, onReplace, reportLoopCount, reportLoopCountMethods inherited from class com.oracle.truffle.api.nodes.Node
accept, adoptChildren, atomic, atomic, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, replace, replace, reportPolymorphicSpecialize, reportReplace, toString
-
Constructor Details
-
JSToIntegerWithTruncationNode
public JSToIntegerWithTruncationNode()
-
-
Method Details
-
execute
-
executeIntOrThrow
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
-
create
-
doInteger
protected static int doInteger(int value) -
doLong
protected static long doLong(long value) -
doBoolean
protected static int doBoolean(boolean value) -
doSafeInteger
-
doDouble
protected double doDouble(double value) -
doNull
-
doUndefined
-
doSymbol
-
doBigInt
-
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)
-