Files
ladybird/Tests/LibJS/Bytecode/expected/var-shadow-in-default-param.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

59 lines
1.5 KiB
Plaintext

$b1c0097f var-shadow-in-default-param.js:7:1
Registers: 8
Blocks: 1
Constants:
[0] = String("outer")
[1] = Undefined
block0:
[ 0] SetGlobal `shadow`, src:String("outer")
[ 18] GetGlobal dst:reg6, `shadow_in_default`
[ 30] Call dst:reg5, callee:reg6, this_value:Undefined, shadow_in_default
[ 50] GetGlobal dst:reg7, `no_conflict`
[ 68] Call dst:reg6, callee:reg7, this_value:Undefined, no_conflict
[ 88] End value:reg6
shadow_in_default$8b450421 var-shadow-in-default-param.js:8:32
Registers: 7
Blocks: 3
Constants:
[0] = Undefined
[1] = String("inner")
block0:
[ 0] JumpUndefined condition:arg0, true_target:block1, false_target:block2
block1:
[ 10] GetInitializedBinding dst:reg5, `shadow`
[ 28] Mov dst:arg0, src:reg5
block2:
[ 38] CreateVariableEnvironment capacity:1
[ 40] GetLexicalEnvironment dst:reg5
[ 48] Mov dst:reg6, src:Undefined
[ 58] CreateVariable `shadow`, is_immutable:false, is_global:false, is_strict:false
[ 68] InitializeVariableBinding `shadow`, src:reg6
[ 80] SetLexicalBinding `shadow`, src:String("inner")
[ 98] Return value:arg0
no_conflict$0d2d606f var-shadow-in-default-param.js:17:5
Registers: 6
Blocks: 3
Locals: y~0
Constants:
[0] = Int32(1)
[1] = Undefined
[2] = Int32(2)
block0:
[ 0] JumpUndefined condition:arg0, true_target:block1, false_target:block2
block1:
[ 10] Mov dst:arg0, src:Int32(1)
block2:
[ 20] Mov3 dst1:reg5, src1:Undefined, dst2:y~0, src2:reg5, dst3:y~0, src3:Int32(2)
[ 40] Return value:y~0