Class JSToIntegerAsLongNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.js.nodes.JavaScriptBaseNode
com.oracle.truffle.js.nodes.cast.JSToIntegerAsLongNode
- All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface, Cloneable
Basically ECMAScript ToInteger, but correct only for values in the safe integer range. Used by
built-in functions that do not care about values outside this range, such as array length or
array index conversion. Returns long; values that do not fit into long will be clamped to
Long.MAX_VALUE or Long.MIN_VALUE.
- See Also:
-
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 TypeMethodDescriptionstatic JSToIntegerAsLongNodecreate()protected final longprotected static longdoBoolean(boolean value) protected static longdoDouble(double value) protected static longdoDoubleInfinite(double value) protected static longdoInteger(int value) protected longdoJSObject(JSObject value, JSToNumberNode toNumberNode) protected longdoJSOrForeignObject(Object value, JSToNumberNode toNumberNode) protected static longdoLong(long value) protected static longprotected static longdoSafeInteger(SafeInteger value) protected longdoString(com.oracle.truffle.api.strings.TruffleString value, JSToIntegerAsLongNode nestedToIntegerNode, JSStringToNumberNode stringToNumberNode) protected final longprotected static longdoUndefined(Object value) abstract longexecuteLong(Object operand) 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
-
JSToIntegerAsLongNode
public JSToIntegerAsLongNode()
-
-
Method Details
-
create
-
executeLong
-
doInteger
protected static long doInteger(int value) -
doBoolean
protected static long doBoolean(boolean value) -
doLong
protected static long doLong(long value) -
doSafeInteger
-
doDouble
protected static long doDouble(double value) -
doDoubleInfinite
protected static long doDoubleInfinite(double value) -
doUndefined
-
doNull
-
doSymbol
-
doBigInt
-
doString
protected long doString(com.oracle.truffle.api.strings.TruffleString value, JSToIntegerAsLongNode nestedToIntegerNode, JSStringToNumberNode stringToNumberNode) -
doJSObject
-
doJSOrForeignObject
-