1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 09:07:35 +00:00

LibJS: Remove FinishUnwind instruction

This is essentially a LeaveUnwind+Jump, so lets just do that, that will
make it easier to optimize it, or see unwind state transitions
This commit is contained in:
Hendiadyoin1 2022-11-13 18:38:15 +01:00 committed by Ali Mohammad Pur
parent fc332be2e5
commit 133faa0acc
5 changed files with 2 additions and 46 deletions

View file

@ -744,19 +744,6 @@ void EnterUnwindContext::replace_references_impl(BasicBlock const& from, BasicBl
m_finalizer_target = Label { to };
}
ThrowCompletionOr<void> FinishUnwind::execute_impl(Bytecode::Interpreter& interpreter) const
{
interpreter.leave_unwind_context();
interpreter.jump(m_next_target);
return {};
}
void FinishUnwind::replace_references_impl(BasicBlock const& from, BasicBlock const& to)
{
if (&m_next_target.block() == &from)
m_next_target = Label { to };
}
void CopyObjectExcludingProperties::replace_references_impl(Register from, Register to)
{
if (m_from_object == from)
@ -1229,11 +1216,6 @@ DeprecatedString EnterUnwindContext::to_deprecated_string_impl(Bytecode::Executa
return DeprecatedString::formatted("EnterUnwindContext handler:{} finalizer:{} entry:{}", handler_string, finalizer_string, m_entry_point);
}
DeprecatedString FinishUnwind::to_deprecated_string_impl(Bytecode::Executable const&) const
{
return DeprecatedString::formatted("FinishUnwind next:{}", m_next_target);
}
DeprecatedString LeaveEnvironment::to_deprecated_string_impl(Bytecode::Executable const&) const
{
auto mode_string = m_mode == EnvironmentMode::Lexical