LibJS: Pass ExecutionContext to Interpreter::run_executable()

This avoids having to get it from the VM's context stack, since most
callers already have it on hand.
This commit is contained in:
Andreas Kling 2025-10-29 09:32:38 +01:00 committed by Andreas Kling
parent a7d13b107e
commit 9dae1acc31
Notes: github-actions[bot] 2025-10-29 20:21:51 +00:00
9 changed files with 31 additions and 33 deletions

View file

@ -34,9 +34,9 @@ public:
ThrowCompletionOr<Value> run(Script&, GC::Ptr<Environment> lexical_environment_override = nullptr);
ThrowCompletionOr<Value> run(SourceTextModule&);
ThrowCompletionOr<Value> run(Bytecode::Executable& executable, Optional<size_t> entry_point = {}, Value initial_accumulator_value = js_special_empty_value())
ThrowCompletionOr<Value> run(ExecutionContext& context, Executable& executable, Optional<size_t> entry_point = {}, Value initial_accumulator_value = js_special_empty_value())
{
auto result_and_return_register = run_executable(executable, entry_point, initial_accumulator_value);
auto result_and_return_register = run_executable(context, executable, entry_point, initial_accumulator_value);
return move(result_and_return_register.value);
}
@ -44,7 +44,7 @@ public:
ThrowCompletionOr<Value> value;
Value return_register_value;
};
ResultAndReturnRegister run_executable(Bytecode::Executable&, Optional<size_t> entry_point, Value initial_accumulator_value = js_special_empty_value());
ResultAndReturnRegister run_executable(ExecutionContext&, Executable&, Optional<size_t> entry_point, Value initial_accumulator_value = js_special_empty_value());
ALWAYS_INLINE Value& accumulator() { return reg(Register::accumulator()); }
ALWAYS_INLINE Value& saved_return_value() { return reg(Register::saved_return_value()); }