Files
ladybird/Tests/LibJS/Bytecode/expected/named-function-expression.txt
Andreas Kling 7f89158d20 LibJS: Replace implicit environment stack with explicit registers
Replace the saved_lexical_environments stack in ExecutionContextRareData
with explicit register-based environment tracking. Environments are now
stored in registers and restored via SetLexicalEnvironment, making the
environment flow visible in bytecode.

Key changes:
- Add GetLexicalEnvironment and SetLexicalEnvironment opcodes
- CreateLexicalEnvironment takes explicit parent and dst operands
- EnterObjectEnvironment stores new environment in a dst register
- NewClass takes an explicit class_environment operand
- Remove LeaveLexicalEnvironment opcode (instead: SetLexicalEnvironment)
- Remove saved_lexical_environments from ExecutionContextRareData
- Use a reserved register for the saved lexical environment to avoid
  dominance issues with lazily-emitted GetLexicalEnvironment
2026-02-09 16:35:39 +01:00

13 lines
591 B
Plaintext

JS bytecode executable ""
[ 0] 0: GetLexicalEnvironment dst:reg4
[ 8] CreateLexicalEnvironment dst:reg5, parent:reg4, capacity:0
[ 18] CreateVariable identifier:Oops, is_immutable:true, is_global:false, is_strict:false
[ 28] NewFunction dst:reg6
[ 40] InitializeLexicalBinding identifier:Oops, src:reg6
[ 58] SetLexicalEnvironment environment:reg4
[ 60] SetGlobal identifier:Oops, src:reg6
[ 70] GetGlobal dst:reg5, identifier:Oops
[ 80] GetById dst:reg7, base:reg5, property:x, base_identifier:Oops
[ 98] End value:reg7