Files
ladybird/Libraries/LibJS/Runtime
Andreas Kling c0e520463e LibJS: Invalidate prototype chains via per-shape child lists
invalidate_all_prototype_chains_leading_to_this used to scan every
prototype shape in the realm and walk each one's chain looking for
the mutated shape. That was O(N_prototype_shapes x chain_depth) per
mutation and showed up hot in real profiles when a page churned a
lot of prototype state during startup.

Each prototype shape now keeps a weak list of the prototype shapes
whose immediate [[Prototype]] points at the object that owns this
shape. The list is registered on prototype-shape creation
(clone_for_prototype, set_prototype_shape) and migrated to the new
prototype shape when the owning prototype object transitions to a
new shape. Invalidation is then a recursive walk over this direct-
child registry, costing O(transitive descendants).

Saves ~300 ms of main thread time when loading https://youtube.com/
on my Linux machine. :^)
2026-04-24 18:59:01 +02:00
..
2026-03-19 21:55:10 -05:00
2026-03-20 12:03:36 +01:00
2026-02-26 13:54:35 -05:00
2026-04-03 21:21:09 +02:00
2026-03-20 12:03:36 +01:00