mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-20 03:25:13 +00:00
LibJS: Don't track "last result" of ScopeNode if we don't need it
This prevents unnecessary bytecode register allocation.
This commit is contained in:
parent
c845c90e98
commit
9c0b185ab8
Notes:
github-actions[bot]
2025-04-08 16:54:20 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/9c0b185ab87 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4283 Reviewed-by: https://github.com/Hendiadyoin1 Reviewed-by: https://github.com/trflynn89
1 changed files with 4 additions and 2 deletions
|
@ -56,8 +56,10 @@ Bytecode::CodeGenerationErrorOr<Optional<ScopedOperand>> ScopeNode::generate_byt
|
|||
Optional<ScopedOperand> last_result;
|
||||
for (auto& child : children()) {
|
||||
auto result = TRY(child->generate_bytecode(generator));
|
||||
if (result.has_value())
|
||||
last_result = result;
|
||||
if (generator.must_propagate_completion()) {
|
||||
if (result.has_value())
|
||||
last_result = result;
|
||||
}
|
||||
if (generator.is_current_block_terminated())
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue