Class TruffleString.ByteIndexOfStringSetNode
java.lang.Object
com.oracle.truffle.api.nodes.Node
com.oracle.truffle.api.strings.TruffleString.ByteIndexOfStringSetNode
- All Implemented Interfaces:
NodeInterface, Cloneable
- Enclosing class:
TruffleString
Node to find the byte index of the first occurrence of any string contained in a given string
set. See
execute(AbstractTruffleString, int, int, TruffleString.StringSet) for
details.- Since:
- 25.1
-
Nested Class Summary
Nested classes/interfaces inherited from class Node
Node.Child, Node.Children -
Method Summary
Modifier and TypeMethodDescriptioncreate()Create a newTruffleString.ByteIndexOfStringSetNode.abstract longexecute(AbstractTruffleString a, int fromByteIndex, int toByteIndex, TruffleString.StringSet stringSet) Returns the byte index of the first occurrence of any string present in the givenTruffleString.StringSet, bounded byfromByteIndex(inclusive) andtoByteIndex(exclusive).Get the uncached version ofTruffleString.ByteIndexOfStringSetNode.static booleanresultIsMatch(long result) Returnstrueif the given result, as returned byexecute(AbstractTruffleString, int, int, TruffleString.StringSet), represents a successful match.static intunpackResultByteIndex(long result) Returns the byte index part of a result returned byexecute(AbstractTruffleString, int, int, TruffleString.StringSet).static intunpackResultPatternIndex(long result) Returns the pattern index part of a result returned byexecute(AbstractTruffleString, int, int, TruffleString.StringSet).Methods inherited from class 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 abstract long execute(AbstractTruffleString a, int fromByteIndex, int toByteIndex, TruffleString.StringSet stringSet) Returns the byte index of the first occurrence of any string present in the givenTruffleString.StringSet, bounded byfromByteIndex(inclusive) andtoByteIndex(exclusive). The returnedlongpacks the resulting byte index into the high 32 bits and the matching pattern's index into the low 32 bits. If no match is found, the result packs-1for both fields. If multiple strings match at the first matching byte index, the string with the lowest index in the array passed toTruffleString.StringSet.fromArray(AbstractTruffleString[], Encoding)is selected.TruffleString.ByteIndexOfStringSetNodewill specialize on the givenTruffleString.StringSet's content, which is therefore required to bepartial evaluation constant.- Since:
- 25.1
-
unpackResultByteIndex
public static int unpackResultByteIndex(long result) Returns the byte index part of a result returned byexecute(AbstractTruffleString, int, int, TruffleString.StringSet).- Since:
- 25.1
-
unpackResultPatternIndex
public static int unpackResultPatternIndex(long result) Returns the pattern index part of a result returned byexecute(AbstractTruffleString, int, int, TruffleString.StringSet).- Since:
- 25.1
-
resultIsMatch
public static boolean resultIsMatch(long result) Returnstrueif the given result, as returned byexecute(AbstractTruffleString, int, int, TruffleString.StringSet), represents a successful match.- Since:
- 25.1
-
create
Create a newTruffleString.ByteIndexOfStringSetNode.- Since:
- 25.1
-
getUncached
Get the uncached version ofTruffleString.ByteIndexOfStringSetNode.- Since:
- 25.1
-