ladybird/Tests/LibJS/Bytecode/expected/eval-same-function.txt
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

39 lines
979 B
Text

$49b95e06 eval-same-function.js:10:1
Registers: 7
Blocks: 1
Constants:
[0] = Undefined
block0:
[ 0] GetGlobal dst:reg6, `foo`
[ 10] Call dst:reg5, callee:reg6, this_value:Undefined, foo
[ 30] End value:reg5
foo$3e35f384 eval-same-function.js:6:9
Registers: 8
Blocks: 1
Constants:
[0] = String("var x = 1")
[1] = Undefined
[2] = Int32(42)
block0:
[ 0] CreateArguments is_immutable:false
[ 10] DynamicGetCalleeAndThisFromEnvironment callee:reg6, this_value:reg7, `eval`
[ 28] CallDirectEval dst:reg5, callee:reg6, this_value:reg7, eval, arguments:[String("var x = 1")]
[ 50] DynamicGetBinding dst:reg6, `Number`
[ 60] CallConstruct dst:reg5, callee:reg6, Number, arguments:[Int32(42)]
[ 80] Return value:reg5
eval$d8e83433 line 1, column 1
Registers: 5
Blocks: 1
Constants:
[0] = Int32(1)
[1] = Undefined
block0:
[ 0] DynamicSetLexicalBinding `x`, src:Int32(1)
[ 10] End value:Undefined