LibJS: Move bytecode interpreter state to VM

The bytecode interpreter only needed the running execution context,
but still threaded a separate Interpreter object through both the C++
and asm entry points. Move that state and the bytecode execution
helpers onto VM instead, and teach the asm generator and slow paths to
use VM directly.
This commit is contained in:
Andreas Kling 2026-04-13 11:54:04 +02:00 committed by Andreas Kling
parent ff5273084d
commit 2ca7dfa649
Notes: github-actions[bot] 2026-04-13 16:31:24 +00:00
37 changed files with 1170 additions and 1266 deletions

View file

@ -5,11 +5,12 @@
*/
#include <AK/TypeCasts.h>
#include <LibJS/Bytecode/Interpreter.h>
#include <LibJS/Bytecode/Debug.h>
#include <LibJS/Runtime/AsyncFunctionDriverWrapper.h>
#include <LibJS/Runtime/AsyncGenerator.h>
#include <LibJS/Runtime/GeneratorObject.h>
#include <LibJS/Runtime/NativeJavaScriptBackedFunction.h>
#include <LibJS/Runtime/VM.h>
#include <LibJS/RustIntegration.h>
namespace JS {
@ -72,7 +73,7 @@ ThrowCompletionOr<Value> NativeJavaScriptBackedFunction::call()
{
auto& vm = this->vm();
auto result = TRY(vm.bytecode_interpreter().run_executable(vm.running_execution_context(), bytecode_executable(), {}));
auto result = TRY(vm.run_executable(vm.running_execution_context(), bytecode_executable(), {}));
auto kind = this->kind();
if (kind == FunctionKind::Normal)