ladybird/Libraries/LibJS
Andreas Kling e49ab8a1f2 LibJS: Make prototype shape tracking per-Realm instead of global
The set of all prototype shapes was a process-global static, which
meant that Shape::invalidate_all_prototype_chains_leading_to_this()
had to iterate over every prototype shape from every Realm in the
process.

This was catastrophic for pages that load many SVG-as-img resources,
since each SVG image creates its own Realm with a full set of JS
intrinsics and web prototypes. With N SVG images, each adding ~100
properties to their ObjectPrototype, this became O(N * 100 * M)
where M is the total number of prototype shapes across all Realms.

Since prototype chains never cross Realm boundaries, we can scope
the tracking to each Realm, making the invalidation cost independent
of the number of Realms in the process.
2026-03-24 08:28:47 +01:00
..
AsmIntGen LibJS: Re-box double arithmetic results as Int32 when possible 2026-03-19 09:42:04 +01:00
Bytecode LibJS: Don't cache dictionary shapes in NewObject premade shape cache 2026-03-22 11:10:01 -05:00
BytecodeDef LibJS: Use the 2024 Rust edition for AsmIntGen and ByteCodeDef 2026-03-11 16:57:09 -04:00
Contrib/Test262 LibJS: Make more use of Value::is and Value::as_if 2026-02-28 10:24:37 -05:00
Heap LibJS: Eliminate GeneratorResult GC cell allocation on yield/await 2026-03-20 15:57:23 -05:00
Runtime LibJS: Make prototype shape tracking per-Realm instead of global 2026-03-24 08:28:47 +01:00
Rust LibJS: Copy object of member expression to preserve evaluation order 2026-03-22 15:40:38 +01:00
CMakeLists.txt LibJS: Eliminate GeneratorResult GC cell allocation on yield/await 2026-03-20 15:57:23 -05:00
Console.cpp LibJS: Replace IndexedProperties with inline Packed/Holey/Dictionary 2026-03-17 22:28:35 -05:00
Console.h LibJS: Add source locations to console.trace() 2026-02-06 11:58:07 +00:00
CyclicModule.cpp LibJS: Align async module rejection order with fulfillment order 2025-12-17 15:33:26 +01:00
CyclicModule.h LibJS: Sync additional Import Attributes spec changes 2025-10-22 10:58:19 +02:00
Forward.h LibJS: Remove remaining C++ pipeline artifacts 2026-03-19 21:55:10 -05:00
LocalVariable.h LibJS: Port the Identifier AST (and related) nodes to UTF-16 2025-08-13 09:56:13 -04:00
Module.cpp LibGC: Enforce that a Cell type must declare the allocator to use 2026-01-20 12:00:11 +01:00
Module.h LibGC: Enforce that a Cell type must declare the allocator to use 2026-01-20 12:00:11 +01:00
ModuleEntry.h LibJS: Remove C++ AST 2026-03-19 21:55:10 -05:00
ModuleLoading.h LibGC+Everywhere: Factor out a LibGC from LibJS 2024-11-15 14:49:20 +01:00
ParserError.cpp LibJS: Port the JS lexer and parser to UTF-16 2025-08-13 09:56:13 -04:00
ParserError.h LibJS: Port the JS lexer and parser to UTF-16 2025-08-13 09:56:13 -04:00
Position.h LibJS: Store full realized SourceRange with each AST node 2025-12-29 13:36:01 +01:00
Print.cpp LibJS: Replace IndexedProperties with inline Packed/Holey/Dictionary 2026-03-17 22:28:35 -05:00
Print.h LibJS: Enable EXPLICIT_SYMBOL_EXPORT and annotate minimum symbol set 2025-07-22 11:51:29 -04:00
RustIntegration.cpp LibJS: Remove C++ parser 2026-03-19 21:55:10 -05:00
RustIntegration.h LibJS: Remove C++ AST 2026-03-19 21:55:10 -05:00
Script.cpp LibJS: Remove C++ compiler pipeline fallback paths 2026-03-19 21:55:10 -05:00
Script.h LibJS: Remove C++ compiler pipeline fallback paths 2026-03-19 21:55:10 -05:00
SourceCode.cpp LibJS: Cache ASCII-to-UTF-16 source conversion for Rust compilation 2026-02-25 00:00:52 +01:00
SourceCode.h LibJS: Cache ASCII-to-UTF-16 source conversion for Rust compilation 2026-02-25 00:00:52 +01:00
SourceRange.h LibJS: Remove C++ AST 2026-03-19 21:55:10 -05:00
SourceTextModule.cpp LibJS: Remove C++ compiler pipeline fallback paths 2026-03-19 21:55:10 -05:00
SourceTextModule.h LibJS: Remove C++ AST 2026-03-19 21:55:10 -05:00
SyntaxHighlighter.cpp LibJS: Fix syntax highlighter position starting at invalid sentinel 2026-03-20 15:32:33 +01:00
SyntaxHighlighter.h LibJS: Enable EXPLICIT_SYMBOL_EXPORT and annotate minimum symbol set 2025-07-22 11:51:29 -04:00
SyntheticModule.cpp Revert "LibJS: Shrink ExecutionContext by replacing ScriptOrModule …" 2026-03-11 23:13:18 +00:00
SyntheticModule.h LibJS+LibWeb+WebContent: Port JS::PropertyKey to UTF-16 2025-08-05 07:07:15 -04:00
Token.h LibJS: Remove C++ lexer, use Rust tokenizer for syntax highlighting 2026-03-19 21:55:10 -05:00