public class TRegexOptions extends Object
Modifier and Type | Field and Description |
---|---|
static int |
RegexMaxCacheSize
Maximum number of entries in the global compilation cache in
RegexLanguage . |
static boolean |
TRegexEnableNodeSplitter
Try to make control flow through DFAs reducible by node splitting (see
DFANodeSplit ). |
static boolean |
TRegexEnableTraceFinder
Try to pre-calculate results of tree-like expressions (see
NFATraceFinderGenerator ). |
static int |
TRegexGenerateDFAThreshold
Number of regex searches done without generating a DFA for a given regular expression.
|
static int |
TRegexMaxCountedRepetition
Bailout threshold for counted repetitions.
|
static int |
TRegexMaxDFASize
Bailout threshold for number of nodes in the DFA (
TRegexDFAExecutorNode generated by
DFAGenerator ). |
static int |
TRegexMaxDFASizeAfterNodeSplitting
Maximum size of a DFA after being altered by
DFANodeSplit . |
static int |
TRegexMaxNFASize
Bailout threshold for number of nodes in the NFA (
NFA generated by
NFAGenerator ). |
static int |
TRegexMaxNumberOfASTSuccessorsInOneASTStep
Bailout threshold for number of ASTSuccessor instances allowed in a single
ASTStep . |
static int |
TRegexMaxNumberOfCaptureGroups
Bailout threshold for number of capture groups.
|
static int |
TRegexMaxNumberOfNFAStatesInOneDFATransition
Maximum number of NFA states involved in one DFA transition.
|
static int |
TRegexMaxParseTreeSize
Bailout threshold for number of nodes in the parser tree (
RegexAST generated by
RegexParser ). |
static int |
TRegexRangeToBitSetConversionThreshold
Minimum number of ranges that have the same high byte to convert into a bit set in a
RangeListMatcher or
RangeTreeMatcher . |
static int |
TRegexTraceFinderMaxNumberOfResults
Maximum number of pre-calculated results per TraceFinder DFA.
|
Constructor and Description |
---|
TRegexOptions() |
public static final int TRegexGenerateDFAThreshold
public static final boolean TRegexEnableTraceFinder
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.public static final int TRegexTraceFinderMaxNumberOfResults
byte
in
TraceFinderDFAStateNode
, with 255 being reserved for "no result"!public static final boolean TRegexEnableNodeSplitter
DFANodeSplit
).
This option will increase performance at the cost of startup time and memory usage.public static final int TRegexMaxDFASizeAfterNodeSplitting
DFANodeSplit
.public static final int TRegexRangeToBitSetConversionThreshold
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.
public static final int TRegexMaxParseTreeSize
RegexAST
generated by
RegexParser
). This number must not be higher than Short.MAX_VALUE
, because we
use short
values for indexing AST nodes. The current setting is based on run times of
graal/com.oracle.truffle.js.test/js/trufflejs/regexp/npm_extracted/hungry-regexp*.js
public static final int TRegexMaxNFASize
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
public static final int TRegexMaxNumberOfASTSuccessorsInOneASTStep
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.public static final int TRegexMaxDFASize
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
public static final int RegexMaxCacheSize
RegexLanguage
.public static final int TRegexMaxCountedRepetition
public static final int TRegexMaxNumberOfCaptureGroups
byte
in
DFACaptureGroupPartialTransition
!public static final int TRegexMaxNumberOfNFAStatesInOneDFATransition
DFACaptureGroupPartialTransition
.