Class JSToIntegerAsIntNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.js.nodes.JavaScriptBaseNode
com.oracle.truffle.js.nodes.cast.JSToIntegerAsIntNode
- All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface, Cloneable
Basically ECMAScript ToInteger, but correct only for values in the int32 range. Used by built-in
functions that do not care about values outside this range, such as string index conversion.
Larger and smaller values will be clamped to Integer.MAX_VALUE and Integer.MIN_VALUE,
respectively.
- 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 JSToIntegerAsIntNodecreate()protected final intprotected static intdoBoolean(boolean value) protected static intdoDouble(double value) protected static intdoInteger(int value) protected intdoJSObject(JSObject value, JSToNumberNode toNumberNode) protected intdoJSOrForeignObject(Object value, JSToNumberNode toNumberNode) protected static intdoLongInt32Range(long value) protected static intdoLongOther(long value) protected static intprotected static intprotected static intdoSafeIntegerOther(SafeInteger value) protected intdoString(com.oracle.truffle.api.strings.TruffleString value, JSToIntegerAsIntNode nestedToIntegerNode, JSStringToNumberNode stringToNumberNode) protected final intprotected static intdoUndefined(Object value) abstract intexecuteInt(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
-
JSToIntegerAsIntNode
public JSToIntegerAsIntNode()
-
-
Method Details
-
create
-
executeInt
-
doInteger
protected static int doInteger(int value) -
doBoolean
protected static int doBoolean(boolean value) -
doLongInt32Range
protected static int doLongInt32Range(long value) -
doLongOther
protected static int doLongOther(long value) -
doSafeIntegerInt32Range
-
doSafeIntegerOther
-
doDouble
protected static int doDouble(double value) -
doUndefined
-
doNull
-
doSymbol
-
doBigInt
-
doString
protected int doString(com.oracle.truffle.api.strings.TruffleString value, JSToIntegerAsIntNode nestedToIntegerNode, JSStringToNumberNode stringToNumberNode) -
doJSObject
-
doJSOrForeignObject
-