mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 14:58:46 +00:00
LibJS: Remove JIT compiler
The JIT compiler was an interesting experiment, but ultimately the security & complexity cost of doing arbitrary code generation at runtime is far too high. In subsequent commits, the bytecode format will change drastically, and instead of rewriting the JIT to fit the new bytecode, this patch simply removes the JIT instead. Other engines, JavaScriptCore in particular, have already proven that it's possible to handle the vast majority of contemporary web content with an interpreter. They are currently ~5x faster than us on benchmarks when running without a JIT. We need to catch up to them before considering performance techniques with a heavy security cost.
This commit is contained in:
parent
cac11ac891
commit
1d29f9081f
Notes:
sideshowbarker
2024-07-16 22:54:10 +09:00
Author: https://github.com/awesomekling
Commit: 1d29f9081f
Pull-request: https://github.com/SerenityOS/serenity/pull/23259
Reviewed-by: https://github.com/trflynn89 ✅
12 changed files with 8 additions and 4347 deletions
|
@ -15,8 +15,6 @@
|
|||
#include <LibJS/Bytecode/Interpreter.h>
|
||||
#include <LibJS/Bytecode/Label.h>
|
||||
#include <LibJS/Bytecode/Op.h>
|
||||
#include <LibJS/JIT/Compiler.h>
|
||||
#include <LibJS/JIT/NativeExecutable.h>
|
||||
#include <LibJS/Runtime/AbstractOperations.h>
|
||||
#include <LibJS/Runtime/Array.h>
|
||||
#include <LibJS/Runtime/BigInt.h>
|
||||
|
@ -373,21 +371,7 @@ Interpreter::ValueAndFrame Interpreter::run_and_return_frame(Executable& executa
|
|||
|
||||
vm().execution_context_stack().last()->executable = &executable;
|
||||
|
||||
if (auto native_executable = executable.get_or_create_native_executable()) {
|
||||
auto block_index = 0;
|
||||
if (entry_point)
|
||||
block_index = executable.basic_blocks.find_first_index_if([&](auto const& block) { return block.ptr() == entry_point; }).value();
|
||||
native_executable->run(vm(), block_index);
|
||||
|
||||
#if 0
|
||||
for (size_t i = 0; i < vm().running_execution_context().local_variables.size(); ++i) {
|
||||
dbgln("%{}: {}", i, vm().running_execution_context().local_variables[i]);
|
||||
}
|
||||
#endif
|
||||
|
||||
} else {
|
||||
run_bytecode();
|
||||
}
|
||||
run_bytecode();
|
||||
|
||||
dbgln_if(JS_BYTECODE_DEBUG, "Bytecode::Interpreter did run unit {:p}", &executable);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue