ladybird/Libraries/LibJS/Rust
Andreas Kling 4ac744082b LibJS: Cache dynamic environment coordinates
Dynamic environment binding opcodes lost the old coordinate warmup.
They were split away from the static coordinate opcodes. Hot closures
and eval-sensitive functions then resolved the same binding by name on
every execution, which regressed JS benchmark throughput badly.

Give each dynamic environment opcode a per-executable coordinate cache
slot. The cache keeps the bytecode stream immutable while letting both
interpreters take a direct declarative environment fast path after the
first lookup. Keep the existing eval invalidation behavior and only warm
caches for declarative-only chains so with environments continue to
observe object shadowing.

Reject cached bytecode that uses the no-cache sentinel for dynamic
environment coordinate cache operands, since execution indexes those
cache arrays unconditionally.

Rebaseline bytecode expectations for the instruction size changes. Add
coverage for with-object shadowing across repeated dynamic lookups and
for rejecting corrupt dynamic environment cache indices.
2026-05-19 15:54:23 +02:00
..
src LibJS: Cache dynamic environment coordinates 2026-05-19 15:54:23 +02:00
build.rs LibJS: Cache dynamic environment coordinates 2026-05-19 15:54:23 +02:00
Cargo.toml LibJS: Use foldhash in parser and scope-collector hash maps 2026-05-05 13:53:51 +02:00
cbindgen.toml LibJS: Add bytecode validator scaffolding driven from Bytecode.def 2026-05-03 08:43:19 +02:00