Andreas Kling
66fb0a8394
LibRegex/Rust: Add the ECMA-262 regex engine
...
Add LibRegex's new Rust ECMAScript regular expression engine.
Replace the old parser's direct pattern-to-bytecode pipeline with a
split architecture: parse patterns into a lossless AST first, then
lower that AST into bytecode for a dedicated backtracking VM. Keep the
syntax tree as the place for validation, analysis, and optimization
instead of teaching every transformation to rewrite partially built
bytecode.
Specialize this backend for the job LibJS actually needs. The old C++
engine shared one generic parser and matcher stack across ECMA-262 and
POSIX modes and supported both byte-string and UTF-16 inputs. The new
engine focuses on ECMA-262 semantics on WTF-16 data, which lets it
model lone surrogates and other JavaScript-specific behavior directly
instead of carrying POSIX and multi-encoding constraints through the
whole implementation.
Fill in the ECMAScript features needed to replace the old engine for
real web workloads: Unicode properties and sets, lookahead and
lookbehind, named groups and backreferences, modifier groups, string
properties, large quantifiers, lone surrogates, and the parser and VM
corner cases those features exercise.
Reshape the runtime around compile-time pattern hints and a hotter VM
loop. Pre-resolve Unicode properties, derive first-character,
character-class, and simple-scan filters, extract safe trailing
literals for anchored patterns, add literal and literal-alternation
fast paths, and keep reusable scratch storage for registers,
backtracking state, and modifier stacks. Teach `find_all` to stay
inside one VM so global searches stop paying setup costs on every
match.
Make those shortcuts semantics-aware instead of merely fast. In Unicode
mode, do not use literal fast paths for lone surrogates, since
ECMA-262 must not let `/\ud83d/u` match inside a surrogate pair.
Likewise, only derive end-anchor suffix hints when the suffix lies on
every path to `Match`, so lookarounds and disjunctions cannot skip into
a shared tail and produce false negatives.
This commit lands the Rust crate, the C++ wrapper, the build
integration, and the initial LibJS-side plumbing needed to exercise
the new engine under real RegExp callers before removing the legacy
backend.
2026-03-27 17:32:19 +01:00
..
2026-03-14 08:17:03 -04:00
2025-11-30 11:54:54 +01:00
2026-03-13 14:43:45 -04:00
2026-03-19 21:55:10 -05:00
2026-03-19 21:55:10 -05:00
2025-07-22 11:51:29 -04:00
2025-04-25 14:07:51 +02:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2025-09-17 12:44:44 +02:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2025-12-10 17:40:57 -06:00
2025-12-10 17:40:57 -06:00
2026-03-17 22:28:35 -05:00
2026-03-17 22:28:35 -05:00
2026-03-18 13:59:05 -05:00
2026-03-18 13:59:05 -05:00
2026-02-28 10:24:37 -05:00
2025-07-22 11:51:29 -04:00
2026-02-27 17:19:33 +01:00
2025-07-22 11:51:29 -04:00
2025-12-09 21:44:13 -06:00
2025-11-30 11:54:54 +01:00
2026-03-17 22:28:35 -05:00
2025-11-02 20:05:47 +01:00
2025-06-02 00:15:36 +02:00
2025-07-22 11:51:29 -04:00
2026-03-17 22:28:35 -05:00
2025-07-22 11:51:29 -04:00
2025-01-17 20:46:32 +01:00
2025-07-22 11:51:29 -04:00
2025-01-17 20:46:32 +01:00
2025-07-22 11:51:29 -04:00
2026-02-27 17:19:33 +01:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2025-11-02 20:05:47 +01:00
2025-11-02 20:05:47 +01:00
2026-03-11 13:33:47 +01:00
2025-07-22 11:51:29 -04:00
2026-03-16 19:15:03 -05:00
2026-03-16 19:15:03 -05:00
2025-07-22 11:51:29 -04:00
2026-03-20 15:57:23 -05:00
2026-03-20 15:57:23 -05:00
2026-03-11 13:33:47 +01:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2026-02-27 17:19:33 +01:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2025-12-03 12:08:40 +01:00
2025-07-22 11:51:29 -04:00
2025-08-14 10:27:08 +02:00
2025-08-14 10:27:08 +02:00
2025-05-23 11:57:21 +02:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2026-02-27 17:19:33 +01:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2026-02-27 17:19:33 +01:00
2025-07-22 11:51:29 -04:00
2026-03-11 13:33:47 +01:00
2026-02-12 11:37:43 +01:00
2026-02-27 17:19:33 +01:00
2026-02-11 23:57:41 +01:00
2026-01-07 12:48:58 +01:00
2026-01-07 12:48:58 +01:00
2026-02-26 13:54:35 -05:00
2025-08-23 16:04:36 -06:00
2026-03-20 12:03:36 +01:00
2025-04-05 11:20:26 +02:00
2025-07-22 11:51:29 -04:00
2025-08-17 07:28:56 -04:00
2025-08-23 16:04:36 -06:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2026-02-27 17:19:33 +01:00
2025-07-22 11:51:29 -04:00
2025-04-29 07:33:08 -04:00
2025-07-22 11:51:29 -04:00
2026-03-20 14:46:46 +01:00
2026-01-16 07:00:02 -05:00
2026-02-27 17:19:33 +01:00
2025-07-22 11:51:29 -04:00
2025-05-26 18:48:09 +02:00
2026-02-27 17:19:33 +01:00
2025-07-22 11:51:29 -04:00
2026-02-11 23:57:41 +01:00
2026-02-11 23:57:41 +01:00
2025-01-17 20:46:32 +01:00
2025-07-22 11:51:29 -04:00
2025-01-17 20:46:32 +01:00
2025-07-22 11:51:29 -04:00
2025-04-05 11:20:26 +02:00
2025-07-22 11:51:29 -04:00
2026-03-20 15:58:05 -05:00
2026-03-20 15:58:05 -05:00
2026-01-27 10:58:39 +01:00
2026-01-27 10:58:39 +01:00
2026-03-20 12:03:36 +01:00
2026-03-11 13:33:47 +01:00
2026-03-11 13:33:47 +01:00
2026-02-27 17:19:33 +01:00
2025-07-22 11:51:29 -04:00
2026-02-27 17:19:33 +01:00
2025-07-22 11:51:29 -04:00
2025-08-18 13:42:22 +02:00
2026-02-26 13:54:35 -05:00
2026-03-20 15:57:23 -05:00
2026-03-20 15:57:23 -05:00
2025-12-25 20:21:37 +01:00
2025-07-22 11:51:29 -04:00
2025-12-09 21:44:13 -06:00
2025-07-22 11:51:29 -04:00
2025-12-09 21:44:13 -06:00
2025-07-22 11:51:29 -04:00
2026-03-19 21:55:10 -05:00
2025-07-22 11:51:29 -04:00
2025-11-30 11:54:54 +01:00
2025-12-21 12:08:41 -06:00
2026-03-07 13:09:59 +01:00
2026-03-07 13:09:59 +01:00
2026-03-17 22:28:35 -05:00
2025-10-29 21:20:10 +01:00
2026-03-11 13:33:47 +01:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2026-03-20 15:57:23 -05:00
2026-03-20 15:57:23 -05:00
2026-03-19 21:55:10 -05:00
2025-07-22 11:51:29 -04:00
2025-08-05 07:07:15 -04:00
2025-08-05 07:07:15 -04:00
2026-02-14 17:29:13 +01:00
2025-07-22 11:51:29 -04:00
2026-03-17 22:28:35 -05:00
2026-03-17 22:28:35 -05:00
2026-03-04 18:53:12 +01:00
2026-03-04 18:53:12 +01:00
2026-03-19 21:55:10 -05:00
2025-12-17 12:50:17 -06:00
2026-03-19 21:55:10 -05:00
2026-02-26 13:54:35 -05:00
2026-03-08 10:27:13 +01:00
2026-02-26 13:54:35 -05:00
2025-12-03 12:08:40 +01:00
2025-12-03 12:08:40 +01:00
2025-12-03 12:08:40 +01:00
2025-07-22 11:51:29 -04:00
2025-12-03 12:08:40 +01:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2026-02-27 17:19:33 +01:00
2026-01-12 13:53:28 -05:00
2025-07-22 11:51:29 -04:00
2026-01-07 12:48:58 +01:00
2025-12-09 21:44:13 -06:00
2025-07-22 11:51:29 -04:00
2026-01-07 12:48:58 +01:00
2026-02-17 12:25:27 +00:00
2025-06-02 00:15:36 +02:00
2025-07-22 11:51:29 -04:00
2025-10-03 08:58:40 +02:00
2025-10-03 08:58:40 +02:00
2026-01-23 15:53:27 +01:00
2025-07-22 11:51:29 -04:00
2025-08-05 07:07:15 -04:00
2025-08-05 07:07:15 -04:00
2025-09-17 12:44:44 +02:00
2025-09-21 15:06:32 +02:00
2026-03-19 21:55:10 -05:00
2026-02-11 23:57:41 +01:00
2025-12-25 23:59:21 +01:00
2026-03-20 15:57:23 -05:00
2026-02-12 11:37:43 +01:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2026-02-27 17:19:33 +01:00
2025-07-22 11:51:29 -04:00
2026-03-17 22:28:35 -05:00
2026-03-17 22:28:35 -05:00
2025-12-09 21:44:13 -06:00
2025-07-22 11:51:29 -04:00
2025-09-17 12:44:44 +02:00
2025-08-05 07:07:15 -04:00
2026-03-08 10:27:13 +01:00
2025-07-22 11:51:29 -04:00
2026-02-26 00:02:17 +01:00
2026-01-30 20:57:42 +01:00
2025-08-05 07:07:15 -04:00
2025-08-05 07:07:15 -04:00
2026-02-27 17:19:33 +01:00
2025-12-21 12:08:41 -06:00
2025-12-09 21:44:13 -06:00
2025-08-23 16:04:36 -06:00
2026-03-11 13:33:47 +01:00
2025-07-22 11:51:29 -04:00
2025-04-05 11:20:26 +02:00
2025-07-22 11:51:29 -04:00
2025-12-09 21:44:13 -06:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2025-09-17 12:44:44 +02:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2026-01-18 10:10:04 +01:00
2026-01-06 10:55:56 +01:00
2026-01-06 00:01:01 +01:00
2026-03-20 12:03:36 +01:00
2026-02-27 17:19:33 +01:00
2025-12-09 21:44:13 -06:00
2025-07-22 11:51:29 -04:00
2026-03-11 13:33:47 +01:00
2026-03-07 13:09:59 +01:00
2025-04-24 09:33:49 -04:00
2025-07-22 11:51:29 -04:00
2026-03-11 23:13:18 +00:00
2026-03-24 08:28:47 +01:00
2025-12-09 21:44:13 -06:00
2026-03-20 12:03:36 +01:00
2025-12-09 21:44:13 -06:00
2025-07-22 11:51:29 -04:00
2026-03-19 21:55:10 -05:00
2025-07-22 11:51:29 -04:00
2025-12-03 13:45:26 +01:00
2025-08-13 09:56:13 -04:00
2026-02-26 13:50:11 +01:00
2025-08-23 16:04:36 -06:00
2026-03-27 17:32:19 +01:00
2025-12-13 13:51:12 -06:00
2025-05-03 20:01:20 +02:00
2025-07-22 11:51:29 -04:00
2025-07-18 12:45:38 -04:00
2025-07-22 11:51:29 -04:00
2026-02-06 13:50:54 +01:00
2025-09-26 16:21:18 +02:00
2025-07-22 11:51:29 -04:00
2026-02-28 10:24:37 -05:00
2025-11-02 20:05:47 +01:00
2025-06-02 00:15:36 +02:00
2025-07-22 11:51:29 -04:00
2025-12-09 21:44:13 -06:00
2025-07-22 11:51:29 -04:00
2026-03-19 21:55:10 -05:00
2026-01-19 10:48:12 +01:00
2025-07-22 11:51:29 -04:00
2025-12-09 21:44:13 -06:00
2025-07-22 11:51:29 -04:00
2026-03-24 08:28:47 +01:00
2026-03-08 10:27:13 +01:00
2026-02-27 17:19:33 +01:00
2025-07-22 11:51:29 -04:00
2026-02-27 17:19:33 +01:00
2026-01-04 07:47:55 +01:00
2026-03-19 21:55:10 -05:00
2026-03-19 21:55:10 -05:00
2025-12-09 21:44:13 -06:00
2025-07-22 11:51:29 -04:00
2026-02-28 10:24:37 -05:00
2025-11-02 20:05:47 +01:00
2025-06-02 00:15:36 +02:00
2025-07-22 11:51:29 -04:00
2026-03-17 22:28:35 -05:00
2025-09-21 15:06:32 +02:00
2026-03-08 10:27:13 +01:00
2025-10-03 09:03:40 +02:00
2025-07-22 11:51:29 -04:00
2025-09-17 12:44:44 +02:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2025-08-05 07:07:15 -04:00
2025-08-05 07:07:15 -04:00
2025-12-09 21:44:13 -06:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2026-02-27 17:19:33 +01:00
2025-07-22 11:51:29 -04:00
2026-02-27 17:19:33 +01:00
2026-03-18 13:59:05 -05:00
2025-12-09 21:44:13 -06:00
2025-08-05 07:07:15 -04:00
2026-02-27 17:19:33 +01:00
2025-07-22 11:51:29 -04:00
2025-11-29 09:39:43 -05:00
2025-11-29 09:39:43 -05:00
2026-03-20 12:03:36 +01:00
2026-03-08 10:27:13 +01:00
2026-03-20 12:03:36 +01:00
2025-10-11 20:08:58 +02:00
2025-05-14 02:01:59 -06:00
2026-03-16 19:15:03 -05:00
2026-03-16 19:15:03 -05:00
2025-12-20 09:13:19 -06:00
2026-02-28 10:24:37 -05:00
2025-07-22 11:51:29 -04:00
2025-10-03 08:58:40 +02:00
2025-10-03 08:58:40 +02:00
2026-01-07 07:52:03 -05:00
2025-07-22 11:51:29 -04:00
2025-12-09 21:44:13 -06:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2025-08-23 16:04:36 -06:00
2025-07-22 11:51:29 -04:00
2025-12-09 21:44:13 -06:00
2025-07-22 11:51:29 -04:00
2025-07-22 11:51:29 -04:00
2026-03-11 23:13:18 +00:00
2026-02-12 11:37:43 +01:00