Package com.oracle.truffle.api.strings
Class TruffleString.GetInternalByteArrayNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.strings.TruffleString.GetInternalByteArrayNode
- All Implemented Interfaces:
NodeInterface
,Cloneable
- Enclosing class:
TruffleString
Node to get a string's internal byte array. See
execute(AbstractTruffleString, TruffleString.Encoding)
for details.- Since:
- 22.1
-
Nested Class Summary
Nested classes/interfaces inherited from class com.oracle.truffle.api.nodes.Node
Node.Child, Node.Children
-
Method Summary
Modifier and TypeMethodDescriptioncreate()
Create a newTruffleString.GetInternalByteArrayNode
.abstract InternalByteArray
execute
(AbstractTruffleString a, TruffleString.Encoding expectedEncoding) Get the given string's internal byte array.Get the uncached version ofTruffleString.GetInternalByteArrayNode
.Methods inherited from class com.oracle.truffle.api.nodes.Node
accept, adoptChildren, atomic, atomic, copy, deepCopy, getChildren, getCost, getDebugProperties, getDescription, getEncapsulatingSourceSection, getLock, getParent, getRootNode, getSourceSection, insert, insert, isAdoptable, isSafelyReplaceableBy, notifyInserted, onReplace, replace, replace, reportPolymorphicSpecialize, toString
-
Method Details
-
execute
public abstract InternalByteArray execute(AbstractTruffleString a, TruffleString.Encoding expectedEncoding) Get the given string's internal byte array. The returned byte array must not be modified. Note that this operation may also return a copy of the string's internal storage, if the internal format does not match the regular encoded string format; compacted and native strings will always yield a copy. CAUTION: TruffleString re-uses internal byte arrays whenever possible, DO NOT modify the arrays returned by this operation. Use this operation only when absolutely necessary. Reading a string's contents should always be done via nodes likeTruffleString.ReadByteNode
,TruffleString.ReadCharUTF16Node
,TruffleString.CodePointAtIndexNode
,TruffleString.CodePointAtByteIndexNode
etc., if at all possible. If mutability is required, useMutableTruffleString
instead.- Since:
- 22.1
-
create
Create a newTruffleString.GetInternalByteArrayNode
.- Since:
- 22.1
-
getUncached
Get the uncached version ofTruffleString.GetInternalByteArrayNode
.- Since:
- 22.1
-