Files
ladybird/Tests/LibJS/Bytecode/expected/annexb-function-existing-var.txt
Andreas Kling 3a08f7b95f LibJS: Drop dead entry GetLexicalEnvironment loads
Teach the Rust bytecode generator to treat the synthetic entry
GetLexicalEnvironment as a removable prologue load.

We still model reg4 as the saved entry lexical environment during
codegen, but assemble() now deletes that load when no emitted
instruction refers to the saved environment register. This keeps the
semantics of unwinding and environment restoration intact while letting
empty functions and other simple bodies start at their first real
instruction.
2026-04-13 18:29:43 +02:00

35 lines
1.1 KiB
Plaintext

$d99dc022 annexb-function-existing-var.js:10:1
Registers: 7
Blocks: 1
Constants:
[0] = Undefined
block0:
[ 0] GetGlobal dst:reg6, `test`
[ 18] Call dst:reg5, callee:reg6, this_value:Undefined, test
[ 38] End value:reg5
test$de75bc07 annexb-function-existing-var.js:2:5
Registers: 7
Blocks: 1
Constants:
[0] = Undefined
[1] = Int32(123)
[2] = Bool(true)
block0:
[ 0] GetLexicalEnvironment dst:reg4
[ 8] CreateVariable `f`, is_immutable:false, is_global:false, is_strict:false
[ 18] InitializeVariableBinding `f`, src:Undefined
[ 30] SetLexicalBinding `f`, src:Int32(123)
[ 48] CreateLexicalEnvironment dst:reg5, parent:reg4, capacity:0
[ 58] CreateMutableBinding environment:reg5, `f`, can_be_deleted:false
[ 68] NewFunction dst:reg6, shared_function_data_index:0
[ 80] InitializeLexicalBinding `f`, src:reg6
[ 98] GetBinding dst:reg6, `f`
[ b0] SetVariableBinding `f`, src:reg6
[ c8] SetLexicalEnvironment environment:reg4
[ d0] GetInitializedBinding dst:reg5, `f`
[ e8] Return value:reg5