Class TRegexOptions

java.lang.Object
com.oracle.truffle.regex.tregex.TRegexOptions

public class TRegexOptions extends Object
  • Field Details

    • TRegexGenerateDFAThresholdCalls

      public static final int TRegexGenerateDFAThresholdCalls
      Number of regex searches done without generating a DFA for a given regular expression. When this threshold is reached, TRegex tries to generate a fully expanded DFA to speed up further searches. This threshold is only checked in interpreter mode, so it should be sufficiently smaller than the Graal compilation threshold!
      See Also:
    • TRegexGenerateDFAThresholdCharacters

      public static final int TRegexGenerateDFAThresholdCharacters
      If a regex could have processed more than this number of characters without generating a fully expanded DFA, then we go ahead and generate the fully expanded DFA even before the TRegexGenerateDFAThresholdCalls threshold is met.
      See Also:
    • TRegexEnableTraceFinder

      public static final boolean TRegexEnableTraceFinder
      Try to pre-calculate results of tree-like expressions (see NFATraceFinderGenerator). A regular expression is considered tree-like if it does not contain infinite loops (+ or *). This option will increase performance at the cost of startup time and memory usage.
      See Also:
    • TRegexTraceFinderMaxNumberOfResults

      public static final int TRegexTraceFinderMaxNumberOfResults
      Maximum number of pre-calculated results per TraceFinder DFA. This number must not be higher than 254, because we compress the result indices to byte in TraceFinderDFAStateNode, with 255 being reserved for "no result"!
      See Also:
    • TRegexEnableNodeSplitter

      public static final boolean TRegexEnableNodeSplitter
      Try to make control flow through DFAs reducible by node splitting (see DFANodeSplit). This option will increase performance at the cost of startup time and memory usage.
      See Also:
    • TRegexMaxDFASizeAfterNodeSplitting

      public static final int TRegexMaxDFASizeAfterNodeSplitting
      Maximum size of a DFA after being altered by DFANodeSplit.
      See Also:
    • TRegexRangeToBitSetConversionThreshold

      public static final int TRegexRangeToBitSetConversionThreshold
      Minimum number of ranges that have the same high byte to convert into a bit set in a RangeListMatcher or RangeTreeMatcher. The threshold value must be greater than 1. Example:
           [က-ဠ], [ူ-၀], [ၐ-ၠ]
           are three ranges that have the same high byte (0x10).
           if TRegexRangeToBitSetConversionThreshold is <= 3, they will be converted to a
           bit set if they appear in a RangeList or RangeTree matcher.
       
      See Also:
    • TRegexParserTreeMaxSize

      public static final int TRegexParserTreeMaxSize
      Bailout threshold for number of nodes in the parser tree (RegexAST generated by RegexASTBuilder).
      See Also:
    • TRegexParserTreeMaxNumberOfSequencesInGroup

      public static final int TRegexParserTreeMaxNumberOfSequencesInGroup
      Bailout threshold for number of Sequences in a Group.
      See Also:
    • TRegexParserTreeMaxNumberOfTermsInSequence

      public static final int TRegexParserTreeMaxNumberOfTermsInSequence
      Bailout threshold for number of Terms in a Sequence.
      See Also:
    • TRegexMaxParseTreeSizeForDFA

      public static final int TRegexMaxParseTreeSizeForDFA
      Parser trees bigger than this setting will not be considered for DFA generation. The current setting is based on run times of graal/com.oracle.truffle.js.test/js/trufflejs/regexp/npm_extracted/hungry-regexp*.js
      See Also:
    • TRegexMaxNFASize

      public static final int TRegexMaxNFASize
      Bailout threshold for number of nodes in the NFA (NFA generated by NFAGenerator). This number must not be higher than Short.MAX_VALUE, because we use short values for indexing NFA nodes. The current setting is based on run times of graal/com.oracle.truffle.js.test/js/trufflejs/regexp/npm_extracted/hungry-regexp*.js
      See Also:
    • TRegexMaxNumberOfASTSuccessorsInOneASTStep

      public static final int TRegexMaxNumberOfASTSuccessorsInOneASTStep
      Bailout threshold for number of ASTSuccessor instances allowed in a single ASTStep. It is possible to construct patterns where the number of NFA transitions grows exponentially. ASTStep is an intermediate data structure between the AST and the NFA, which is filled eagerly and can cause an OutOfMemoryError if not capped. Since ASTSuccessors roughly correspond to NFA transitions, the cap has been set to the maximum number of NFA transitions we allow in a single NFA.
      See Also:
    • TRegexMaxDFASize

      public static final int TRegexMaxDFASize
      Bailout threshold for number of nodes in the DFA (TRegexDFAExecutorNode generated by DFAGenerator). This number must not be higher than Short.MAX_VALUE, because we use short values for indexing DFA nodes. The current setting is based on run times of graal/com.oracle.truffle.js.test/js/trufflejs/regexp/npm_extracted/hungry-regexp*.js
      See Also:
    • TRegexMaxDFATransitions

      public static final int TRegexMaxDFATransitions
      Bailout threshold for number of transitions in the DFA (TRegexDFAExecutorNode generated by DFAGenerator).
      See Also:
    • TRegexMaxEagerCGDFACost

      public static final int TRegexMaxEagerCGDFACost
      Maximum capture group tracking cost of eager capture group tracking DFA matchers.
      See Also:
    • TRegexMaxDFACGPartialTransitions

      public static final int TRegexMaxDFACGPartialTransitions
      Bailout threshold for number of partial capture group transitions in the DFA (TRegexDFAExecutorNode generated by DFAGenerator).
      See Also:
    • TRegexQuantifierUnrollThresholdSingleCC

      public static final int TRegexQuantifierUnrollThresholdSingleCC
      The parser will try to unroll bounded quantifiers on single character classes up to this limit.
      See Also:
    • TRegexQuantifierUnrollThresholdGroup

      public static final int TRegexQuantifierUnrollThresholdGroup
      The parser will try to unroll bounded quantifiers on groups up to this limit.
      See Also:
    • TRegexMaxNumberOfCaptureGroups

      public static final int TRegexMaxNumberOfCaptureGroups
      Bailout threshold for number of capture groups.
      See Also:
    • TRegexMaxNumberOfCaptureGroupsForDFA

      public static final int TRegexMaxNumberOfCaptureGroupsForDFA
      Bailout threshold for number of capture groups in the DFA generator. This number must not be higher than 127, because we compress capture group boundary indices to byte in DFACaptureGroupPartialTransition!
      See Also:
    • TRegexMaxNumberOfNFAStatesInOneDFATransition

      public static final int TRegexMaxNumberOfNFAStatesInOneDFATransition
      Maximum number of NFA states involved in one DFA transition. This number must not be higher than 255, because the maximum number of NFA states in one DFA transition determines the number of simultaneously tracked result sets (arrays) in capture group tracking mode, which are accessed over byte indices in DFACaptureGroupPartialTransition.
      See Also:
    • TRegexMaxPureNFASize

      public static final int TRegexMaxPureNFASize
      Bailout threshold for number of nodes in the pure NFA (PureNFA generated by PureNFAGenerator).
      See Also:
    • TRegexMaxPureNFATransitions

      public static final int TRegexMaxPureNFATransitions
      Bailout threshold for number of transitions in the pure NFA (PureNFA generated by PureNFAGenerator).
      See Also:
    • TRegexMaxBackTrackerMergeExplodeSize

      public static final int TRegexMaxBackTrackerMergeExplodeSize
      Maximum number of PureNFA states allowed to be exploded in TRegexBacktrackingNFAExecutorNode.
      See Also:
    • TRegexMaxTransitionsInTrivialExecutor

      public static final int TRegexMaxTransitionsInTrivialExecutor
      Maximum number of transitions for a TRegexExecutorNode to be considered trivial.
      See Also:
    • CODE_RANGE_EVALUATION_THRESHOLD

      public static final int CODE_RANGE_EVALUATION_THRESHOLD
      Don't force evaluation of TruffleString.CodeRange if the input string's byte length is greater than this threshold.
      See Also:
  • Constructor Details

    • TRegexOptions

      public TRegexOptions()