Class JSTypedArraySortNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.js.nodes.JavaScriptBaseNode
com.oracle.truffle.js.nodes.array.JSTypedArraySortNode
- All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface,Cloneable
Sorts the elements of a
JSTypedArrayObject.
Copies the elements to a temporary array (of a suitable primitive or boxed type, depending on the
element type and comparator), sorts the array using the comparator (natural order if null),
performs a detached buffer check, and then copies it to a typed array of the same element type
and length, which may be the same, or a newly allocated typed array instance.
Used by %TypedArray%.prototype.sort,toSorted.-
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 TypeMethodDescriptionprotected final voiddoCached(JSTypedArrayObject fromArray, JSTypedArrayObject toArray, int length, Comparator<Object> comparator, TypedArray fromType, TypedArray toType, boolean comparatorIsNull, TypedArray cachedFromType, TypedArray cachedToType, boolean cachedComparatorIsNull, com.oracle.truffle.api.interop.InteropLibrary interop) protected final voiddoUncached(JSTypedArrayObject fromArray, JSTypedArrayObject toArray, int length, Comparator<Object> comparator, TypedArray fromType, TypedArray toType, boolean comparatorIsNull, com.oracle.truffle.api.interop.InteropLibrary interop) abstract voidexecute(JSTypedArrayObject fromArray, JSTypedArrayObject toArray, int length, Comparator<Object> comparator) Methods inherited from class com.oracle.truffle.js.nodes.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
-
JSTypedArraySortNode
protected JSTypedArraySortNode()
-
-
Method Details
-
execute
public abstract void execute(JSTypedArrayObject fromArray, JSTypedArrayObject toArray, int length, Comparator<Object> comparator) -
doCached
protected final void doCached(JSTypedArrayObject fromArray, JSTypedArrayObject toArray, int length, Comparator<Object> comparator, TypedArray fromType, TypedArray toType, boolean comparatorIsNull, TypedArray cachedFromType, TypedArray cachedToType, boolean cachedComparatorIsNull, com.oracle.truffle.api.interop.InteropLibrary interop) -
doUncached
protected final void doUncached(JSTypedArrayObject fromArray, JSTypedArrayObject toArray, int length, Comparator<Object> comparator, TypedArray fromType, TypedArray toType, boolean comparatorIsNull, com.oracle.truffle.api.interop.InteropLibrary interop)
-