mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-30 11:37:16 +02:00
When MemberExpression::generate_bytecode calls emit_load_from_reference, it only uses the loaded_value and discards the reference operands. For computed member expressions (e.g. a[0]), this was generating an unnecessary Mov to save the property register for potential store-back. Add a ReferenceMode parameter to emit_load_from_reference. When LoadOnly is passed, the computed property path skips the register save and Mov.
20 lines
945 B
Plaintext
20 lines
945 B
Plaintext
JS bytecode executable ""
|
|
[ 0] 0: GetLexicalEnvironment dst:reg4
|
|
[ 8] GetGlobal dst:reg6, identifier:computed_read
|
|
[ 18] NewPrimitiveArray dst:reg7, elements:[1]
|
|
[ 30] Call dst:reg5, callee:reg6, this_value:Undefined, computed_read, arguments:[reg7]
|
|
[ 58] GetGlobal dst:reg7, identifier:computed_read_expression
|
|
[ 68] NewPrimitiveArray dst:reg8, elements:[1]
|
|
[ 80] Call dst:reg6, callee:reg7, this_value:Undefined, computed_read_expression, arguments:[reg8, Int32(0)]
|
|
[ a8] End value:reg6
|
|
|
|
JS bytecode executable "computed_read"
|
|
[ 0] 0: GetLexicalEnvironment dst:reg4
|
|
[ 8] GetByValue dst:reg5, base:arg0, property:Int32(0), base_identifier:a
|
|
[ 20] Return value:reg5
|
|
|
|
JS bytecode executable "computed_read_expression"
|
|
[ 0] 0: GetLexicalEnvironment dst:reg4
|
|
[ 8] GetByValue dst:reg5, base:arg0, property:arg1, base_identifier:a
|
|
[ 20] Return value:reg5
|