Package com.oracle.truffle.api.strings
Class TruffleString.ByteIndexOfStringNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.strings.TruffleString.ByteIndexOfStringNode
- All Implemented Interfaces:
NodeInterface
,Cloneable
- Enclosing class:
TruffleString
TruffleString.IndexOfStringNode
, but with byte indices.- 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.ByteIndexOfStringNode
.final int
execute
(AbstractTruffleString a, AbstractTruffleString b, int fromByteIndex, int toByteIndex, TruffleString.Encoding expectedEncoding) TruffleString.IndexOfStringNode
, but with byte indices.final int
execute
(AbstractTruffleString a, TruffleString.WithMask b, int fromByteIndex, int toByteIndex, TruffleString.Encoding expectedEncoding) TruffleString.IndexOfStringNode
, but with byte indices.Get the uncached version ofTruffleString.ByteIndexOfStringNode
.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 final int execute(AbstractTruffleString a, AbstractTruffleString b, int fromByteIndex, int toByteIndex, TruffleString.Encoding expectedEncoding) TruffleString.IndexOfStringNode
, but with byte indices.- Since:
- 22.1
-
execute
public final int execute(AbstractTruffleString a, TruffleString.WithMask b, int fromByteIndex, int toByteIndex, TruffleString.Encoding expectedEncoding) TruffleString.IndexOfStringNode
, but with byte indices. This variant accepts aTruffleString.WithMask
as the search valueb
, which changes the searching algorithm in the following manner: whenever the contents ofa
andb
are compared, the mask is OR'ed toa
, as shown in this exemplary method:boolean bytesEqualAt(TruffleString a, int byteIndexA, TruffleString.WithMask b, int byteIndexB) { return (readByte(a, byteIndexA) | readByte(b.mask, byteIndexB)) == readByte(b, byteIndexB); }
- Since:
- 22.1
-
create
Create a newTruffleString.ByteIndexOfStringNode
.- Since:
- 22.1
-
getUncached
Get the uncached version ofTruffleString.ByteIndexOfStringNode
.- Since:
- 22.1
-