mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-11 09:27:00 +02:00
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
13 lines
591 B
Plaintext
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
|
|
|