Package com.oracle.truffle.api.strings
Class TruffleString.RegionEqualByteIndexNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.strings.TruffleString.RegionEqualByteIndexNode
- All Implemented Interfaces:
NodeInterface
,Cloneable
- Enclosing class:
TruffleString
Node to check for a region match, byte-by-byte. See
execute(AbstractTruffleString, int, AbstractTruffleString, int, int, TruffleString.Encoding)
and
execute(AbstractTruffleString, int, TruffleString.WithMask, int, int, 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.RegionEqualByteIndexNode
.final boolean
execute
(AbstractTruffleString a, int fromByteIndexA, AbstractTruffleString b, int fromByteIndexB, int length, TruffleString.Encoding expectedEncoding) Checks for a region match, byte-by-byte.final boolean
execute
(AbstractTruffleString a, int fromByteIndexA, TruffleString.WithMask b, int fromByteIndexB, int length, TruffleString.Encoding expectedEncoding) Checks for a region match, byte-by-byte.Get the uncached version ofTruffleString.RegionEqualByteIndexNode
.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, reportReplace, toString
-
Method Details
-
execute
public final boolean execute(AbstractTruffleString a, int fromByteIndexA, AbstractTruffleString b, int fromByteIndexB, int length, TruffleString.Encoding expectedEncoding) Checks for a region match, byte-by-byte.- Since:
- 22.1
-
execute
public final boolean execute(AbstractTruffleString a, int fromByteIndexA, TruffleString.WithMask b, int fromByteIndexB, int length, TruffleString.Encoding expectedEncoding) Checks for a region match, byte-by-byte. This variant accepts aTruffleString.WithMask
as the search valueb
, which changes the matching algorithm in the following manner: when 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.RegionEqualByteIndexNode
.- Since:
- 22.1
-
getUncached
Get the uncached version ofTruffleString.RegionEqualByteIndexNode
.- Since:
- 22.1
-