mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 12:49:19 +00:00
LibJS: Remove almost all uses of Op::Jump::set_targets()
We should initialize jump targets when constructing the jump instruction instead of doing it later. This was already the case in all construction sites but one. This first patch converts all those sites to pass final targets to the constructor directly.
This commit is contained in:
parent
84850700a0
commit
bdd21cf9db
Notes:
sideshowbarker
2024-07-17 20:19:08 +09:00
Author: https://github.com/awesomekling
Commit: bdd21cf9db
Pull-request: https://github.com/SerenityOS/serenity/pull/21256
3 changed files with 67 additions and 98 deletions
|
@ -394,13 +394,13 @@ void Generator::generate_scoped_jump(JumpType type)
|
|||
switch (boundary) {
|
||||
case Break:
|
||||
if (type == JumpType::Break) {
|
||||
emit<Op::Jump>().set_targets(nearest_breakable_scope(), {});
|
||||
emit<Op::Jump>(nearest_breakable_scope());
|
||||
return;
|
||||
}
|
||||
break;
|
||||
case Continue:
|
||||
if (type == JumpType::Continue) {
|
||||
emit<Op::Jump>().set_targets(nearest_continuable_scope(), {});
|
||||
emit<Op::Jump>(nearest_continuable_scope());
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
@ -455,7 +455,7 @@ void Generator::generate_labelled_jump(JumpType type, DeprecatedFlyString const&
|
|||
}
|
||||
|
||||
if (jumpable_scope.language_label_set.contains_slow(label)) {
|
||||
emit<Op::Jump>().set_targets(jumpable_scope.bytecode_target, {});
|
||||
emit<Op::Jump>(jumpable_scope.bytecode_target);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue