mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-07 09:04:30 +00:00
LibJS/Bytecode: Emit for condition check before update statement
This allows jump elision to eliminate an unnecessary jump since things now get laid out naturally in memory (normal execution order).
This commit is contained in:
@@ -888,16 +888,16 @@ Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> ForStatement::gener
|
||||
|
||||
body_block_ptr = &generator.make_block();
|
||||
|
||||
if (m_test)
|
||||
test_block_ptr = &generator.make_block();
|
||||
else
|
||||
test_block_ptr = body_block_ptr;
|
||||
|
||||
if (m_update)
|
||||
update_block_ptr = &generator.make_block();
|
||||
else
|
||||
update_block_ptr = body_block_ptr;
|
||||
|
||||
if (m_test)
|
||||
test_block_ptr = &generator.make_block();
|
||||
else
|
||||
test_block_ptr = body_block_ptr;
|
||||
|
||||
generator.emit<Bytecode::Op::Jump>(Bytecode::Label { *test_block_ptr });
|
||||
|
||||
if (m_test) {
|
||||
|
||||
Reference in New Issue
Block a user