LibJS: Don't try to manage unwind contexts in the execution loop in BC

We are already doing this in a good manner via the generated code,
doing so in the execution loop as well will cause us to pop contexts
multiple times, which is not very good.
This commit is contained in:
Hendiadyoin1 2022-11-13 20:45:31 +01:00 committed by Ali Mohammad Pur
commit c2108489a5
Notes: sideshowbarker 2024-07-17 03:42:53 +09:00

View file

@ -91,10 +91,6 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Executable const& e
m_current_block = unwind_context.handler; m_current_block = unwind_context.handler;
unwind_context.handler = nullptr; unwind_context.handler = nullptr;
// If there's no finalizer, there's nowhere for the handler block to unwind to, so the unwind context is no longer needed.
if (!unwind_context.finalizer)
unwind_contexts().take_last();
accumulator() = exception_value; accumulator() = exception_value;
m_saved_exception = {}; m_saved_exception = {};
will_jump = true; will_jump = true;
@ -102,7 +98,6 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Executable const& e
} }
if (unwind_context.finalizer) { if (unwind_context.finalizer) {
m_current_block = unwind_context.finalizer; m_current_block = unwind_context.finalizer;
unwind_contexts().take_last();
will_jump = true; will_jump = true;
break; break;
} }