ladybird/Tests/LibJS/Bytecode/expected/destructuring-assignment.txt
Andreas Kling a9e54bd745 LibJS: Preserve resolved assignment bindings
Resolve dynamic identifier assignment targets before evaluating the
right hand side, then store through that saved environment record. This
matches the ECMA-262 ordering for simple assignment and var initializers
when a with binding is deleted or direct eval creates a nearer var.

Add runtime coverage for with and direct-eval cases and refresh bytecode
expectations for dynamic assignments that now snapshot the binding
before storing.
2026-05-22 01:56:57 +02:00

215 lines
6.1 KiB
Text

$77163770 destructuring-assignment.js:28:1
Registers: 8
Blocks: 1
Constants:
[0] = Undefined
block0:
[ 0] GetGlobal dst:reg6, `array_destructuring_with_class_default`
[ 10] Call dst:reg5, callee:reg6, this_value:Undefined, array_destructuring_with_class_default
[ 30] GetGlobal dst:reg7, `object_destructuring_with_function_default`
[ 40] Call dst:reg6, callee:reg7, this_value:Undefined, object_destructuring_with_function_default
[ 60] GetGlobal dst:reg7, `setter_parameter_resolution`
[ 70] Call dst:reg5, callee:reg7, this_value:Undefined, setter_parameter_resolution
[ 90] End value:reg5
array_destructuring_with_class_default$5e674578 destructuring-assignment.js:6:10
Registers: 15
Blocks: 18
Locals: x~0
Constants:
[0] = Undefined
[1] = Bool(false)
[2] = Int32(1)
[3] = Int32(2)
block0:
[ 0] GetLexicalEnvironment dst:reg4
[ 8] Mov dst:x~0, src:Undefined
[ 18] NewArray dst:reg5, elements:[Undefined]
[ 30] Mov dst:reg6, src:Bool(false)
[ 40] GetIterator dst_iterator_object:reg7, dst_iterator_next:reg8, dst_iterator_done:reg9, iterable:reg5
[ 58] Jump target:block3
block1:
[ 60] Catch dst:reg11
[ 68] SetLexicalEnvironment environment:reg4
[ 70] Mov dst:reg10, src:Int32(1)
[ 80] JumpIf condition:reg9, true_target:block13, false_target:block12
block2:
[ 90] Return value:x~0
block3:
[ 98] Jump target:block5
block4:
[ a0] Mov dst:reg12, src:Undefined
[ b0] Jump target:block6
block5:
[ b8] IteratorNextUnpack dst_value:reg12, dst_done:reg6, iterator_object:reg7, iterator_next:reg8, iterator_done:reg9
[ d0] JumpTrue condition:reg6, target:block4
block6:
[ e0] JumpUndefined condition:reg12, true_target:block7, false_target:block8
block7:
[ f0] CreateLexicalEnvironment dst:reg13, parent:reg4, capacity:0, is_catch_environment:false
[ 108] CreateVariable `C`, is_immutable:true, is_global:false, is_strict:true
[ 118] SetLexicalEnvironment environment:reg4
[ 120] NewClass dst:reg14, class_environment:reg13, class_blueprint_index:0
[ 140] Mov dst:reg12, src:reg14
block8:
[ 150] Mov dst:x~0, src:reg12
block9:
[ 160] JumpFalse condition:reg9, target:block11
block10:
[ 170] Return value:x~0
block11:
[ 178] IteratorClose iterator_object:reg7, iterator_next:reg8, iterator_done:reg9, completion_value:Undefined
[ 190] Jump target:block10
block12:
[ 198] JumpStrictlyEquals lhs:reg10, rhs:Int32(1), true_target:block14, false_target:block15
block13:
[ 1b0] JumpStrictlyEquals lhs:reg10, rhs:Int32(2), true_target:block16, false_target:block17
block14:
[ 1c8] IteratorClose iterator_object:reg7, iterator_next:reg8, iterator_done:reg9, completion_value:reg11
[ 1e0] Throw src:reg11
block15:
[ 1e8] IteratorClose iterator_object:reg7, iterator_next:reg8, iterator_done:reg9, completion_value:Undefined
[ 200] Jump target:block13
block16:
[ 208] Return value:reg11
block17:
[ 210] Throw src:reg11
Exception handlers:
[ 98 .. b8] => handler block1
[ e0 .. 160] => handler block1
object_destructuring_with_function_default$cadc791a destructuring-assignment.js:12:12
Registers: 8
Blocks: 3
Locals: x~0
Constants:
[0] = Undefined
block0:
[ 0] Mov dst:x~0, src:Undefined
[ 10] NewObject dst:reg5
[ 20] ThrowIfNullish src:reg5
[ 28] GetById dst:reg6, base:reg5, `x`
[ 40] JumpUndefined condition:reg6, true_target:block1, false_target:block2
block1:
[ 50] NewFunction dst:reg7, shared_function_data_index:0 (x)
[ 68] Mov dst:reg6, src:reg7
block2:
[ 78] Mov dst:x~0, src:reg6
[ 88] Return value:x~0
setter_parameter_resolution$dea2547b destructuring-assignment.js:19:9
Registers: 14
Blocks: 16
Constants:
[0] = Undefined
[1] = Bool(false)
[2] = Int32(1)
[3] = Int32(2)
block0:
[ 0] GetLexicalEnvironment dst:reg4
[ 8] CreateVariable `setValue`, is_immutable:false, is_global:false, is_strict:false
[ 18] InitializeVariableBinding `setValue`, src:Undefined
[ 30] NewPrimitiveArray dst:reg5, elements:[23]
[ 48] Mov dst:reg6, src:Bool(false)
[ 58] GetIterator dst_iterator_object:reg7, dst_iterator_next:reg8, dst_iterator_done:reg9, iterable:reg5
[ 70] Jump target:block3
block1:
[ 78] Catch dst:reg11
[ 80] SetLexicalEnvironment environment:reg4
[ 88] Mov dst:reg10, src:Int32(1)
[ 98] JumpIf condition:reg9, true_target:block11, false_target:block10
block2:
[ a8] GetInitializedBinding dst:reg5, `setValue`
[ c0] Return value:reg5
block3:
[ c8] NewObject dst:reg12
[ d8] NewFunction dst:reg13, shared_function_data_index:0 (set y), home_object:reg12
[ f0] PutById base:reg12, `y`, src:reg13, kind:Setter
[ 110] Jump target:block5
block4:
[ 118] Mov dst:reg13, src:Undefined
[ 128] Jump target:block6
block5:
[ 130] IteratorNextUnpack dst_value:reg13, dst_done:reg6, iterator_object:reg7, iterator_next:reg8, iterator_done:reg9
[ 148] JumpTrue condition:reg6, target:block4
block6:
[ 158] PutById base:reg12, `y`, src:reg13, kind:Normal
block7:
[ 178] JumpFalse condition:reg9, target:block9
block8:
[ 188] Jump target:block2
block9:
[ 190] IteratorClose iterator_object:reg7, iterator_next:reg8, iterator_done:reg9, completion_value:Undefined
[ 1a8] Jump target:block8
block10:
[ 1b0] JumpStrictlyEquals lhs:reg10, rhs:Int32(1), true_target:block12, false_target:block13
block11:
[ 1c8] JumpStrictlyEquals lhs:reg10, rhs:Int32(2), true_target:block14, false_target:block15
block12:
[ 1e0] IteratorClose iterator_object:reg7, iterator_next:reg8, iterator_done:reg9, completion_value:reg11
[ 1f8] Throw src:reg11
block13:
[ 200] IteratorClose iterator_object:reg7, iterator_next:reg8, iterator_done:reg9, completion_value:Undefined
[ 218] Jump target:block11
block14:
[ 220] Return value:reg11
block15:
[ 228] Throw src:reg11
Exception handlers:
[ c8 .. 130] => handler block1
[ 158 .. 178] => handler block1
set y$f1335721 destructuring-assignment.js:21:26
Registers: 6
Blocks: 1
Constants:
[0] = Undefined
block0:
[ 0] ResolveBinding dst:reg5, `setValue`
[ 10] SetResolvedBinding environment:reg5, `setValue`, src:arg0
[ 20] End value:Undefined