Files
ladybird/Tests/LibJS/Bytecode/expected/var-binding-access.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

45 lines
1.3 KiB
Plaintext

$12ff989c var-binding-access.js:22:1
Registers: 8
Blocks: 1
Constants:
[0] = Undefined
block0:
[ 0] GetGlobal dst:reg6, `var_access`
[ 18] Call dst:reg5, callee:reg6, this_value:Undefined, var_access
[ 38] GetGlobal dst:reg7, `let_access`
[ 50] Call dst:reg6, callee:reg7, this_value:Undefined, let_access
[ 70] End value:reg6
var_access$84869239 var-binding-access.js:5:5
Registers: 6
Blocks: 1
Constants:
[0] = Undefined
[1] = Int32(1)
block0:
[ 0] CreateVariable `x`, is_immutable:false, is_global:false, is_strict:false
[ 10] InitializeVariableBinding `x`, src:Undefined
[ 28] SetLexicalBinding `x`, src:Int32(1)
[ 40] NewFunction dst:reg5, shared_function_data_index:0
[ 58] GetInitializedBinding dst:reg5, `x`
[ 70] Return value:reg5
let_access$a0a01ad1 var-binding-access.js:14:5
Registers: 7
Blocks: 1
Constants:
[0] = Int32(1)
block0:
[ 0] GetLexicalEnvironment dst:reg4
[ 8] CreateLexicalEnvironment dst:reg5, parent:reg4, capacity:1
[ 18] CreateVariable `x`, is_immutable:false, is_global:false, is_strict:false
[ 28] InitializeLexicalBinding `x`, src:Int32(1)
[ 40] NewFunction dst:reg6, shared_function_data_index:0
[ 58] GetBinding dst:reg6, `x`
[ 70] Return value:reg6