mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
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.
44 lines
949 B
Plaintext
44 lines
949 B
Plaintext
$5904f18d const-assignment-no-extra-tdz.js:1:1
|
|
Registers: 9
|
|
Blocks: 4
|
|
Locals: e~0
|
|
Constants:
|
|
[0] = Undefined
|
|
|
|
block0:
|
|
[ 0] GetLexicalEnvironment dst:reg4
|
|
[ 8] Jump target:block3
|
|
|
|
block1:
|
|
[ 10] Catch dst:reg5
|
|
[ 18] SetLexicalEnvironment environment:reg4
|
|
[ 20] Mov3 dst1:e~0, src1:reg5, dst2:reg6, src2:Undefined, dst3:reg7, src3:reg6
|
|
|
|
block2:
|
|
[ 40] End value:reg6
|
|
|
|
block3:
|
|
[ 48] Mov dst:reg5, src:Undefined
|
|
[ 58] GetGlobal dst:reg8, `f`
|
|
[ 70] Call dst:reg6, callee:reg8, this_value:Undefined, f
|
|
[ 90] Mov2 dst1:reg5, src1:reg6, dst2:reg6, src2:reg5
|
|
[ a8] End value:reg6
|
|
|
|
Exception handlers:
|
|
[ 48 .. b0] => handler block1
|
|
|
|
|
|
f$22fe0a32 const-assignment-no-extra-tdz.js:2:5
|
|
Registers: 5
|
|
Blocks: 1
|
|
Locals: x~0
|
|
Constants:
|
|
[0] = Int32(1)
|
|
[1] = Int32(2)
|
|
[2] = Undefined
|
|
|
|
block0:
|
|
[ 0] Mov dst:x~0, src:Int32(1)
|
|
[ 10] ThrowConstAssignment
|
|
[ 18] End value:Undefined
|