1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:28:12 +00:00

LibJS: Update AST to use completions :^)

This is another major milestone on our journey towards removing global
VM exception state :^)
Does pretty much exactly what it says on the tin: updating
ASTNode::execute() to return a Completion instead of a plain value. This
will *also* allow us to eventually remove the non-standard unwinding
mechanism and purely rely on the various completion types.
This commit is contained in:
Linus Groh 2022-01-02 21:37:50 +01:00
parent 95acb1ce88
commit da856d7742
11 changed files with 507 additions and 692 deletions

View file

@ -315,13 +315,10 @@ void Jump::execute_impl(Bytecode::Interpreter& interpreter) const
void ResolveThisBinding::execute_impl(Bytecode::Interpreter& interpreter) const
{
auto this_binding_or_error = interpreter.vm().resolve_this_binding(interpreter.global_object());
if (this_binding_or_error.is_throw_completion()) {
interpreter.vm().throw_exception(interpreter.global_object(), this_binding_or_error.release_error().value());
auto value_or_error = interpreter.vm().resolve_this_binding(interpreter.global_object());
if (value_or_error.is_error())
return;
}
interpreter.accumulator() = this_binding_or_error.release_value();
interpreter.accumulator() = value_or_error.release_value();
}
void Jump::replace_references_impl(BasicBlock const& from, BasicBlock const& to)