2026-02-23 07:50:46 -03:00
|
|
|
[workspace]
|
|
|
|
|
members = [
|
2026-04-16 22:43:09 -03:00
|
|
|
"Libraries/LibGfx/Rust",
|
2026-02-23 07:50:46 -03:00
|
|
|
"Libraries/LibJS/Rust",
|
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-25 10:41:38 -03:00
|
|
|
"Libraries/LibRegex/Rust",
|
2026-03-10 10:19:29 -03:00
|
|
|
"Libraries/LibUnicode/Rust",
|
2026-04-22 06:48:56 -03:00
|
|
|
"Libraries/LibWasm/Rust",
|
2026-05-23 17:14:22 -03:00
|
|
|
"Libraries/LibWeb/ContentBlocker/Rust",
|
2026-04-15 07:53:15 -03:00
|
|
|
"Libraries/LibWeb/Rust",
|
LibWeb: Replace the HTML tokenizer with Rust
Replace the C++ HTML tokenizer with a Rust implementation behind the
existing HTMLTokenizer API.
Keep the parser-facing integration points for streaming input,
insertion points, document.write(), EOF insertion, parser aborts,
speculative parser input, and last start tag tracking. The generated
FFI handle stays an implementation detail of HTMLTokenizer, so callers
keep a single tokenizer class.
Preserve duplicate attributes through FFI so C++ token normalization can
record the duplicate-attribute signal used by CSP nonce checks. Keep
bulk tag-name and attribute scans capped at the active insertion point
so streamed parser input is spliced at the right offset.
Use generated DAFSA tables for named character references and intern
common tag and attribute names to reduce FFI marshalling overhead. This
also fixes attribute name source positions, nested old insertion points,
and aborted fast-path handling.
TestHTMLTokenizer covers duplicate attributes and insertion points in
fast tag-name, attribute-name, and quoted-value scans. A CSP text test
covers duplicate nonce attributes on parser-created script elements.
The tokenizer dump fixtures still match, TestHTMLTokenizer passes, and
the full release test-web run passes with 6981 tests and 226 skipped.
2026-05-15 10:13:43 -03:00
|
|
|
"Libraries/LibWeb/HTML/Parser/Rust",
|
2026-02-23 07:50:46 -03:00
|
|
|
]
|
2026-03-06 18:07:06 -03:00
|
|
|
exclude = [
|
|
|
|
|
"Libraries/LibJS/AsmIntGen",
|
|
|
|
|
]
|
2026-02-23 07:50:46 -03:00
|
|
|
resolver = "2"
|
2026-02-25 06:14:49 -03:00
|
|
|
|
|
|
|
|
[profile.release]
|
|
|
|
|
panic = "abort"
|
|
|
|
|
|
|
|
|
|
[profile.distribution]
|
|
|
|
|
inherits = "release"
|
|
|
|
|
incremental = false
|
|
|
|
|
codegen-units = 1
|
|
|
|
|
lto = true
|
2026-03-03 10:52:25 -03:00
|
|
|
|
|
|
|
|
[workspace.lints.clippy]
|
|
|
|
|
all = "deny" # includes lintgroups: correctness, suspicious, style, complexity, perf
|
|
|
|
|
# from clippy:nursery:
|
|
|
|
|
redundant_clone = "deny"
|
|
|
|
|
# from clippy:pedantic:
|
|
|
|
|
uninlined_format_args = "deny"
|
|
|
|
|
semicolon_if_nothing_returned = "deny"
|
|
|
|
|
manual_let_else = "deny"
|
|
|
|
|
unnecessary_wraps = "deny"
|
|
|
|
|
manual_assert = "deny"
|
|
|
|
|
ref_option = "deny"
|
|
|
|
|
elidable_lifetime_names = "deny"
|
|
|
|
|
unnested_or_patterns = "deny"
|
|
|
|
|
borrow_as_ptr = "deny"
|
AK: Adopt mimalloc v2 as main allocator
Use mimalloc for Ladybird-owned allocations without overriding malloc().
Route kmalloc(), kcalloc(), krealloc(), and kfree() through mimalloc,
and put the embedded Rust crates on the same allocator via a shared
shim in AK/kmalloc.cpp.
This also lets us drop kfree_sized(), since it no longer used its size
argument. StringData, Utf16StringData, JS object storage, Rust error
strings, and the CoreAudio playback helpers can all free their AK-backed
storage with plain kfree().
Sanitizer builds still use the system allocator. LeakSanitizer does not
reliably trace references stored in mimalloc-managed AK containers, so
static caches and other long-lived roots can look leaked. Pass the old
size into the Rust realloc shim so aligned fallback reallocations can
move posix_memalign-backed blocks safely.
Static builds still need a little linker help. macOS app binaries need
the Rust allocator entry points forced in from liblagom-ak.a, while
static ELF links can pull in identical allocator shim definitions from
multiple Rust staticlibs. Keep the Apple -u flags and allow those
duplicate shim symbols for LibJS and LibRegex links on Linux and BSD.
2026-04-03 12:06:58 -03:00
|
|
|
explicit_iter_loop = "deny"
|