Class JSArrayToDenseObjectArrayNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.js.nodes.JavaScriptBaseNode
com.oracle.truffle.js.nodes.array.JSArrayToDenseObjectArrayNode
- All Implemented Interfaces:
com.oracle.truffle.api.nodes.NodeInterface,Cloneable
Converts a JS array to an Object[]. If the array is sparse or has holes, it is compacted to a
dense array that consists of only actual elements. Note that this node assumes that the array has
only fast own elements and no prototype elements.
Used by
Array.prototype.sort.-
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 Object[]doUncached(JSArrayObject array, ScriptArray arrayType, long length, JSArrayNextElementIndexNode nextElementIndexNode, ReadElementNode readNode, com.oracle.truffle.api.profiles.InlinedBranchProfile growProfile) abstract Object[]executeObjectArray(JSArrayObject array, ScriptArray arrayType, long length) protected static Object[]fromDenseArray(JSArrayObject array, ScriptArray arrayType, long length, ScriptArray cachedArrayType, ReadElementNode readNode) protected static Object[]fromSparseArray(JSArrayObject array, ScriptArray arrayType, long length, ScriptArray cachedArrayType, com.oracle.truffle.api.nodes.Node node, JSArrayNextElementIndexNode nextElementIndexNode, com.oracle.truffle.api.profiles.InlinedBranchProfile growProfile) Methods inherited from class com.oracle.truffle.js.nodes.JavaScriptBaseNode
copy, getJSContext, getLanguage, getLanguageOptions, getRealm, hasOverloadedOperators, onReplaceMethods 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, toString
-
Constructor Details
-
JSArrayToDenseObjectArrayNode
protected JSArrayToDenseObjectArrayNode()
-
-
Method Details
-
executeObjectArray
public abstract Object[] executeObjectArray(JSArrayObject array, ScriptArray arrayType, long length) -
fromDenseArray
protected static Object[] fromDenseArray(JSArrayObject array, ScriptArray arrayType, long length, ScriptArray cachedArrayType, ReadElementNode readNode) -
fromSparseArray
protected static Object[] fromSparseArray(JSArrayObject array, ScriptArray arrayType, long length, ScriptArray cachedArrayType, com.oracle.truffle.api.nodes.Node node, JSArrayNextElementIndexNode nextElementIndexNode, com.oracle.truffle.api.profiles.InlinedBranchProfile growProfile) -
doUncached
protected Object[] doUncached(JSArrayObject array, ScriptArray arrayType, long length, JSArrayNextElementIndexNode nextElementIndexNode, ReadElementNode readNode, com.oracle.truffle.api.profiles.InlinedBranchProfile growProfile)
-