mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-27 03:37:53 +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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user