Commit graph

11 commits

Author SHA1 Message Date
Ali Mohammad Pur
5355710481 LibRegex: Don't treat single-jump blocks as noop in the optimizer 2025-03-09 14:37:57 +01:00
Ali Mohammad Pur
ea3b7efd91 LibRegex: Treat the UnicodeSets flag as Unicode
Fixes /.../v not being interpreted as a unicode pattern.
2025-02-28 14:31:45 -05:00
mikiubo
8a6f7b787e LibRegex: Use depth-first search in regex optimizer
Some checks are pending
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
use depth-first search in optimizer code bacause using breadth-first
search generate a bug. Add test example in test lib.
2025-02-25 00:09:20 +01:00
Ali Mohammad Pur
08ebfaff17 LibRegex: Take trailing inversion state into account in block comparison
Fixes #3421.
2025-02-01 11:30:02 +01:00
Ali Mohammad Pur
50733c564c LibRegex: Use the *actually* correct repeat start offset for Repeat
Fixes #2931 and various frequent crashes.
2024-12-23 13:13:52 +01:00
Ali Mohammad Pur
358378c1c0 LibRegex: Pick the right target for OpCode_Repeat
Repeat's 'offset' field is a bit odd in that it is treated as a negative
offset, causing a backwards jump when positive; the optimizer didn't
correctly model this behaviour, which caused crashes and misopts when
dealing with Repeats.
This commit fixes that behaviour.
2024-12-13 10:00:16 +01:00
Ali Mohammad Pur
4a8d3e35a3 LibRegex: Add some more debugging info to bytecode block ranges
These were getting difficult to differentiate, now they each get a
comment on where they came from to aid with future debugging.
2024-12-13 10:00:16 +01:00
Ali Mohammad Pur
5a4d657a4e LibRegex: Avoid generating ForkJumps when jumping to the next alt block
Fixes #2398.
2024-11-17 20:12:39 +01:00
Ali Mohammad Pur
00bc22c332 LibRegex: Don't immediately ignore TempInverse in optimizer
fe46b2c141 added the reset-temp-inverse flag, but set it up so all
tempinverse ops were negated at the start of the next op; this commit
makes it so these flags actually persist for one op and not zero.

Fixes #2296.
2024-11-17 09:03:29 -05:00
Ali Mohammad Pur
dabd60180f LibRegex: Don't ignore references that weren't bound in checked blocks
Fixes #2281.
2024-11-12 10:37:57 +01:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Renamed from Userland/Libraries/LibRegex/RegexOptimizer.cpp (Browse further)