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.
40 lines
958 B
Plaintext
40 lines
958 B
Plaintext
$e6445d4a eval-same-function.js:10:1
|
|
Registers: 7
|
|
Blocks: 1
|
|
Constants:
|
|
[0] = Undefined
|
|
|
|
block0:
|
|
[ 0] GetGlobal dst:reg6, `foo`
|
|
[ 18] Call dst:reg5, callee:reg6, this_value:Undefined, foo
|
|
[ 38] End value:reg5
|
|
|
|
|
|
foo$a4ff2c4f 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] GetCalleeAndThisFromEnvironment callee:reg6, this_value:reg7, `eval`
|
|
[ 28] CallDirectEval dst:reg5, callee:reg6, this_value:reg7, eval, arguments:[String("var x = 1")]
|
|
[ 50] GetBinding dst:reg6, `Number`
|
|
[ 68] CallConstruct dst:reg5, callee:reg6, Number, arguments:[Int32(42)]
|
|
[ 88] Return value:reg5
|
|
|
|
|
|
eval$3c61584c line 1, column 1
|
|
Registers: 5
|
|
Blocks: 1
|
|
Constants:
|
|
[0] = Int32(1)
|
|
[1] = Undefined
|
|
|
|
block0:
|
|
[ 0] SetLexicalBinding `x`, src:Int32(1)
|
|
[ 18] End value:Undefined
|