ladybird/Tests/LibJS/Bytecode/expected
Andreas Kling 234203ed9b LibJS: Ensure deterministic ordering in scope analysis and codegen
The scope collector uses HashMaps for identifier groups and variables,
which means their iteration order is non-deterministic. This causes
local variable indices and function declaration instantiation (FDI)
bytecode to vary between runs.

Fix this by sorting identifier group keys alphabetically before
assigning local variable indices, and sorting vars_to_initialize by
name before emitting FDI bytecode.

Also make register allocation deterministic by always picking the
lowest-numbered free register instead of whichever one happens to be
at the end of the free list.

This is preparation for bringing in a new source->bytecode pipeline
written in Rust. Checking for regressions is significantly easier
if we can expect identical output from both pipelines.
2026-02-24 09:39:42 +01:00
..
annex-b-function-in-if.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
annexb-function-existing-var.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
argument-postfix-self-move.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
argument-variables.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
arguments-with-arguments-fn.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
assign-to-parameter.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
async-await.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
async-generator-yield-await.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
async-generator-yield.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
async-return-bare.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
baseline.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
bigint-binary-literal-fold.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
bigint-constant-folding.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
bitwise-numeric-preconvert.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
block-function-declaration-order.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
block-scoped-function-no-tdz.txt LibJS: Mark block-scoped function declaration locals as initialized 2026-02-19 02:45:37 +01:00
block-scoping.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
call-spread-register-order.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
captured-variables.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
chained-member-call.txt LibJS: Make MemberExpression::to_string_approximation() recursive 2026-02-15 23:21:46 +01:00
class-computed-field-lhs-name.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
class-computed-key.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
class-environment.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
class-lhs-name-no-createvariable.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
class-literal-fields.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
computed-compound-assign-register-reuse.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
computed-member-access.txt LibJS: Skip unnecessary Mov in emit_load_from_reference for reads 2026-02-15 23:21:46 +01:00
computed-member-compound-assign.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
computed-string-object-literal.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
computed-string-to-ById.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
computed-update-register-order.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
condition-dead-code-elim.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
conditional-register-order.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
const-fold-exponentiation.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
const-fold-template-literals.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
constant-fold-string-to-number.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
default-param-self-reference.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
delete-expression-register.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
delete-super-property.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
destructure-array-rest.txt LibJS: Remove unused bytecode register allocation in array destructuring 2026-02-17 20:44:57 +01:00
destructuring-assignment.txt LibJS: Remove unused bytecode register allocation in array destructuring 2026-02-17 20:44:57 +01:00
destructuring-no-base-identifier.txt LibJS: Remove unused bytecode register allocation in array destructuring 2026-02-17 20:44:57 +01:00
do-while-register-allocation.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
eval-prevents-locals.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
eval-same-function.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
eval-scope-optimization.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
expression-identifier-number-format.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
for-in-block-order.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
for-in-lexical-scope.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
for-in-register-lifetime.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
for-loop-break-after-if-continue.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
for-loop-scoping.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
for-of-iteration-env-capacity.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
for-of-iterator-close.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
for-try-finally-continue.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
generator-yield-call.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
generator-yield-finally.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
generator-yield-star.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
generator-yield.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
global-variables.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
if-else-register-lifetime.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
local-variables.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
logical-assignment-register-order.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
logical-constant-folding.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
logical-or-in-if-condition.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
logical-or-preferred-dst.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
named-function-expression.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
nested-for-loop-completion.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
nested-member-base-identifier.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
numeric-class-field-name.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
numeric-getter-no-lhs-name.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
numeric-index-object-literal.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
numeric-property-key.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
object-rest-computed-key.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
optional-chain-base-identifier.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
optional-chain.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
parameter-createvariable-order.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
private-method-call-description.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
resolve-this-caching.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
sequential-try-blocks.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
super-computed-eval-order.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
super-constructor-call.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
super-evaluation-order.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
super-method-call-order.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
super-optional-call-this.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
switch-completion-value.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
switch-scoping.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
tagged-template-base-identifier.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
this-base-identifier.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
try-catch-completion-ordering.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
try-catch-finally-register.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
try-catch-scoping.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
try-catch-terminated.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
try-finally-continue.txt LibJS: Ensure deterministic ordering in scope analysis and codegen 2026-02-24 09:39:42 +01:00
try-finally.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
update-member-expression.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
var-binding-access.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
var-hoisting-tdz.txt LibJS: Consolidate TDZ check emission into Generator helper 2026-02-17 20:44:57 +01:00
var-init-in-param-body-scope.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
var-shadow-in-default-param.txt LibJS: Don't optimize body vars to locals when referenced in defaults 2026-02-19 02:45:37 +01:00
with-return.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00
with-statement.txt Tests/LibJS: Add a big pile of AST, bytecode, and runtime tests 2026-02-17 20:44:57 +01:00