mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 08:41:15 +00:00
LibJS/Bytecode: Remove BlockBoundaryType::LeaveVariableEnvironment
We never need to manually exit a var environment from bytecode anymore.
This commit is contained in:
parent
ac246d764d
commit
12ce0789da
Notes:
sideshowbarker
2024-07-17 03:27:40 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/12ce0789da Pull-request: https://github.com/SerenityOS/serenity/pull/19424
|
@ -315,9 +315,6 @@ void Generator::generate_break()
|
|||
case LeaveLexicalEnvironment:
|
||||
emit<Bytecode::Op::LeaveEnvironment>(Bytecode::Op::EnvironmentMode::Lexical);
|
||||
break;
|
||||
case LeaveVariableEnvironment:
|
||||
emit<Bytecode::Op::LeaveEnvironment>(Bytecode::Op::EnvironmentMode::Var);
|
||||
break;
|
||||
case Continue:
|
||||
break;
|
||||
case ReturnToFinally: {
|
||||
|
@ -345,8 +342,6 @@ void Generator::generate_break(DeprecatedFlyString const& break_label)
|
|||
last_was_finally = false;
|
||||
} else if (boundary == BlockBoundaryType::LeaveLexicalEnvironment) {
|
||||
emit<Bytecode::Op::LeaveEnvironment>(Bytecode::Op::EnvironmentMode::Lexical);
|
||||
} else if (boundary == BlockBoundaryType::LeaveVariableEnvironment) {
|
||||
emit<Bytecode::Op::LeaveEnvironment>(Bytecode::Op::EnvironmentMode::Var);
|
||||
} else if (boundary == BlockBoundaryType::ReturnToFinally) {
|
||||
auto& block = make_block(DeprecatedString::formatted("{}.break", current_block().name()));
|
||||
emit<Op::ScheduleJump>(Label { block });
|
||||
|
@ -388,9 +383,6 @@ void Generator::generate_continue()
|
|||
case LeaveLexicalEnvironment:
|
||||
emit<Bytecode::Op::LeaveEnvironment>(Bytecode::Op::EnvironmentMode::Lexical);
|
||||
break;
|
||||
case LeaveVariableEnvironment:
|
||||
emit<Bytecode::Op::LeaveEnvironment>(Bytecode::Op::EnvironmentMode::Var);
|
||||
break;
|
||||
case Break:
|
||||
break;
|
||||
case ReturnToFinally: {
|
||||
|
@ -418,8 +410,6 @@ void Generator::generate_continue(DeprecatedFlyString const& continue_label)
|
|||
last_was_finally = false;
|
||||
} else if (boundary == BlockBoundaryType::LeaveLexicalEnvironment) {
|
||||
emit<Bytecode::Op::LeaveEnvironment>(Bytecode::Op::EnvironmentMode::Lexical);
|
||||
} else if (boundary == BlockBoundaryType::LeaveVariableEnvironment) {
|
||||
emit<Bytecode::Op::LeaveEnvironment>(Bytecode::Op::EnvironmentMode::Var);
|
||||
} else if (boundary == BlockBoundaryType::ReturnToFinally) {
|
||||
auto& block = make_block(DeprecatedString::formatted("{}.continue", current_block().name()));
|
||||
emit<Op::ScheduleJump>(Label { block });
|
||||
|
|
|
@ -149,7 +149,6 @@ public:
|
|||
Unwind,
|
||||
ReturnToFinally,
|
||||
LeaveLexicalEnvironment,
|
||||
LeaveVariableEnvironment,
|
||||
};
|
||||
template<typename OpType>
|
||||
void perform_needed_unwinds()
|
||||
|
@ -167,9 +166,6 @@ public:
|
|||
case LeaveLexicalEnvironment:
|
||||
emit<Bytecode::Op::LeaveEnvironment>(Bytecode::Op::EnvironmentMode::Lexical);
|
||||
break;
|
||||
case LeaveVariableEnvironment:
|
||||
emit<Bytecode::Op::LeaveEnvironment>(Bytecode::Op::EnvironmentMode::Var);
|
||||
break;
|
||||
case Break:
|
||||
case Continue:
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue