mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibJS/Bytecode: Emit do...while body before test in codegen
This makes the code flow naturally and allows jump elision to work.
This commit is contained in:
Notes:
sideshowbarker
2024-07-16 20:12:13 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9cbf17f181 Pull-request: https://github.com/SerenityOS/serenity/pull/24240 Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/trflynn89 ✅
@@ -787,8 +787,8 @@ Bytecode::CodeGenerationErrorOr<Optional<Bytecode::Operand>> DoWhileStatement::g
|
||||
// body
|
||||
// jump always (true) test
|
||||
// end
|
||||
auto& test_block = generator.make_block();
|
||||
auto& body_block = generator.make_block();
|
||||
auto& test_block = generator.make_block();
|
||||
auto& load_result_and_jump_to_end_block = generator.make_block();
|
||||
auto& end_block = generator.make_block();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user