mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-09 00:22:36 +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.
28 lines
771 B
Plaintext
28 lines
771 B
Plaintext
$6cc1cfb5 eval-scope-optimization.js:12:1
|
|
Registers: 7
|
|
Blocks: 1
|
|
Constants:
|
|
[0] = Undefined
|
|
|
|
block0:
|
|
[ 0] GetGlobal dst:reg6, `outer`
|
|
[ 18] Call dst:reg5, callee:reg6, this_value:Undefined, outer
|
|
[ 38] End value:reg5
|
|
|
|
|
|
outer$6201e926 eval-scope-optimization.js:9:5
|
|
Registers: 7
|
|
Blocks: 1
|
|
Constants:
|
|
[0] = Undefined
|
|
[1] = Int32(42)
|
|
|
|
block0:
|
|
[ 0] CreateVariable `inner`, is_immutable:false, is_global:false, is_strict:false
|
|
[ 10] InitializeVariableBinding `inner`, src:Undefined
|
|
[ 28] NewFunction dst:reg5, shared_function_data_index:0
|
|
[ 40] SetVariableBinding `inner`, src:reg5
|
|
[ 58] GetGlobal dst:reg6, `Number`
|
|
[ 70] CallConstruct dst:reg5, callee:reg6, Number, arguments:[Int32(42)]
|
|
[ 90] Return value:reg5
|