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

@@ -8,7 +8,6 @@
// NOTE: This file is not named $262Object.cpp because dollar signs in file names cause issues with some build tools.
#include <AK/TypeCasts.h>
#include <LibJS/Bytecode/Interpreter.h>
#include <LibJS/Contrib/Test262/262Object.h>
#include <LibJS/Contrib/Test262/AgentObject.h>
#include <LibJS/Contrib/Test262/GlobalObject.h>
@@ -17,6 +16,7 @@
#include <LibJS/Runtime/ArrayBuffer.h>
#include <LibJS/Runtime/GlobalObject.h>
#include <LibJS/Runtime/Object.h>
#include <LibJS/Runtime/VM.h>
#include <LibJS/Script.h>
namespace JS::Test262 {
@@ -106,7 +106,7 @@ JS_DEFINE_NATIVE_FUNCTION($262Object::eval_script)
}
// 5. Let status be ScriptEvaluation(s).
auto status = vm.bytecode_interpreter().run(script_or_error.value());
auto status = vm.run(script_or_error.value());
// 6. Return Completion(status).
return status;