mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 13:38:11 +00:00
LibRegex: Flatten bytecode before performing optimizations
This avoids doing DisjointChunks traversal for every bytecode access, significantly reducing startup time for large regular expressions.
This commit is contained in:
parent
7bdf0be667
commit
2758d99bbc
1 changed files with 2 additions and 0 deletions
|
@ -17,6 +17,8 @@ using Detail::Block;
|
|||
template<typename Parser>
|
||||
void Regex<Parser>::run_optimization_passes()
|
||||
{
|
||||
parser_result.bytecode.flatten();
|
||||
|
||||
// Rewrite fork loops as atomic groups
|
||||
// e.g. a*b -> (ATOMIC a*)b
|
||||
attempt_rewrite_loops_as_atomic_groups(split_basic_blocks());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue