mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:07:45 +00:00
LibJS: Remove unused realm parameter from run_and_return_frame()
This commit is contained in:
parent
d6e959686d
commit
3ccac0cf6e
9 changed files with 15 additions and 17 deletions
|
@ -708,7 +708,7 @@ ThrowCompletionOr<Value> perform_eval(VM& vm, Value x, CallerMode strict_caller,
|
|||
executable->name = "eval"sv;
|
||||
if (Bytecode::g_dump_bytecode)
|
||||
executable->dump();
|
||||
auto result_or_error = vm.bytecode_interpreter().run_and_return_frame(eval_realm, *executable, nullptr);
|
||||
auto result_or_error = vm.bytecode_interpreter().run_and_return_frame(*executable, nullptr);
|
||||
if (result_or_error.value.is_error())
|
||||
return result_or_error.value.release_error();
|
||||
|
||||
|
|
|
@ -199,7 +199,7 @@ void AsyncGenerator::execute(VM& vm, Completion completion)
|
|||
else
|
||||
bytecode_interpreter.accumulator() = completion_object;
|
||||
|
||||
auto next_result = bytecode_interpreter.run_and_return_frame(realm, *m_generating_function->bytecode_executable(), next_block, frame);
|
||||
auto next_result = bytecode_interpreter.run_and_return_frame(*m_generating_function->bytecode_executable(), next_block, frame);
|
||||
|
||||
if (!m_frame.has_value())
|
||||
m_frame = move(*next_result.frame);
|
||||
|
|
|
@ -626,7 +626,7 @@ ThrowCompletionOr<void> ECMAScriptFunctionObject::function_declaration_instantia
|
|||
} else if (i < execution_context_arguments.size() && !execution_context_arguments[i].is_undefined()) {
|
||||
argument_value = execution_context_arguments[i];
|
||||
} else if (parameter.default_value) {
|
||||
auto value_and_frame = vm.bytecode_interpreter().run_and_return_frame(realm, *m_default_parameter_bytecode_executables[default_parameter_index - 1], nullptr);
|
||||
auto value_and_frame = vm.bytecode_interpreter().run_and_return_frame(*m_default_parameter_bytecode_executables[default_parameter_index - 1], nullptr);
|
||||
if (value_and_frame.value.is_error())
|
||||
return value_and_frame.value.release_error();
|
||||
// Resulting value is in the accumulator.
|
||||
|
@ -998,7 +998,7 @@ void async_block_start(VM& vm, T const& async_body, PromiseCapability const& pro
|
|||
auto& running_context = vm.running_execution_context();
|
||||
|
||||
// 3. Set the code evaluation state of asyncContext such that when evaluation is resumed for that execution context the following steps will be performed:
|
||||
auto execution_steps = NativeFunction::create(realm, "", [&realm, &async_body, &promise_capability, &async_context](auto& vm) -> ThrowCompletionOr<Value> {
|
||||
auto execution_steps = NativeFunction::create(realm, "", [&async_body, &promise_capability, &async_context](auto& vm) -> ThrowCompletionOr<Value> {
|
||||
Completion result;
|
||||
|
||||
// a. If asyncBody is a Parse Node, then
|
||||
|
@ -1009,12 +1009,10 @@ void async_block_start(VM& vm, T const& async_body, PromiseCapability const& pro
|
|||
if (maybe_executable.is_error())
|
||||
result = maybe_executable.release_error();
|
||||
else
|
||||
result = vm.bytecode_interpreter().run_and_return_frame(realm, *maybe_executable.value(), nullptr).value;
|
||||
result = vm.bytecode_interpreter().run_and_return_frame(*maybe_executable.value(), nullptr).value;
|
||||
}
|
||||
// b. Else,
|
||||
else {
|
||||
(void)realm;
|
||||
|
||||
// i. Assert: asyncBody is an Abstract Closure with no parameters.
|
||||
static_assert(IsCallableWithArguments<T, Completion>);
|
||||
|
||||
|
@ -1126,7 +1124,7 @@ Completion ECMAScriptFunctionObject::ordinary_call_evaluate_body()
|
|||
}
|
||||
}
|
||||
|
||||
auto result_and_frame = vm.bytecode_interpreter().run_and_return_frame(realm, *m_bytecode_executable, nullptr);
|
||||
auto result_and_frame = vm.bytecode_interpreter().run_and_return_frame(*m_bytecode_executable, nullptr);
|
||||
|
||||
VERIFY(result_and_frame.frame != nullptr);
|
||||
if (result_and_frame.value.is_error())
|
||||
|
|
|
@ -120,7 +120,7 @@ ThrowCompletionOr<Value> GeneratorObject::execute(VM& vm, Completion const& comp
|
|||
else
|
||||
bytecode_interpreter.accumulator() = completion_object;
|
||||
|
||||
auto next_result = bytecode_interpreter.run_and_return_frame(realm, *m_generating_function->bytecode_executable(), next_block, frame);
|
||||
auto next_result = bytecode_interpreter.run_and_return_frame(*m_generating_function->bytecode_executable(), next_block, frame);
|
||||
|
||||
vm.pop_execution_context();
|
||||
|
||||
|
|
|
@ -178,7 +178,7 @@ ThrowCompletionOr<Value> perform_shadow_realm_eval(VM& vm, StringView source_tex
|
|||
else {
|
||||
auto executable = maybe_executable.release_value();
|
||||
|
||||
auto value_and_frame = vm.bytecode_interpreter().run_and_return_frame(eval_realm, *executable, nullptr);
|
||||
auto value_and_frame = vm.bytecode_interpreter().run_and_return_frame(*executable, nullptr);
|
||||
if (value_and_frame.value.is_error()) {
|
||||
result = value_and_frame.value.release_error();
|
||||
} else {
|
||||
|
|
|
@ -306,7 +306,7 @@ ThrowCompletionOr<void> VM::binding_initialization(NonnullRefPtr<BindingPattern
|
|||
ThrowCompletionOr<Value> VM::execute_ast_node(ASTNode const& node)
|
||||
{
|
||||
auto executable = TRY(Bytecode::compile(*this, node, FunctionKind::Normal, ""sv));
|
||||
auto result_or_error = bytecode_interpreter().run_and_return_frame(*current_realm(), *executable, nullptr);
|
||||
auto result_or_error = bytecode_interpreter().run_and_return_frame(*executable, nullptr);
|
||||
if (result_or_error.value.is_error())
|
||||
return result_or_error.value.release_error();
|
||||
return result_or_error.frame->registers[0];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue