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

LibJS: Convert Instruction::execute in bytecode to ThrowCompletionOr

This allows us to use TRY in these functions :^).
This commit is contained in:
davidot 2022-02-07 14:36:45 +01:00 committed by Linus Groh
parent de90d54be0
commit 8108fc7f9c
6 changed files with 238 additions and 294 deletions

View file

@ -13,7 +13,6 @@
#include <LibJS/Forward.h>
#include <LibJS/Heap/Cell.h>
#include <LibJS/Heap/Handle.h>
#include <LibJS/Runtime/Exception.h>
#include <LibJS/Runtime/Value.h>
namespace JS::Bytecode {
@ -69,7 +68,7 @@ public:
void enter_unwind_context(Optional<Label> handler_target, Optional<Label> finalizer_target);
void leave_unwind_context();
void continue_pending_unwind(Label const& resume_label);
ThrowCompletionOr<void> continue_pending_unwind(Label const& resume_label);
Executable const& current_executable() { return *m_current_executable; }
@ -93,7 +92,7 @@ private:
Value m_return_value;
Executable const* m_current_executable { nullptr };
Vector<UnwindInfo> m_unwind_contexts;
Handle<Exception> m_saved_exception;
Handle<Value> m_saved_exception;
};
extern bool g_dump_bytecode;