mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
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:
committed by
Andreas Kling
parent
ff5273084d
commit
2ca7dfa649
Notes:
github-actions[bot]
2026-04-13 16:31:24 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/2ca7dfa6492 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/8891 Reviewed-by: https://github.com/shannonbooth
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user