LibJS/Bytecode: Remove BlockBoundaryType::LeaveVariableEnvironment

We never need to manually exit a var environment from bytecode anymore.
This commit is contained in:
Andreas Kling 2023-06-16 16:38:25 +02:00
parent ac246d764d
commit 12ce0789da
Notes: sideshowbarker 2024-07-17 03:27:40 +09:00
2 changed files with 0 additions and 14 deletions

View file

@ -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 });

View file

@ -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;