mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
LibJS/JIT: Don't keep trying to JIT unsupported bytecode executables
We now only try jitting each Bytecode::Executable once, and then cache the resulting NativeExecutable.
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 21:16:31 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/310bcd4717 Pull-request: https://github.com/SerenityOS/serenity/pull/21619 Reviewed-by: https://github.com/Hendiadyoin1
@@ -7,6 +7,7 @@
|
||||
#include <LibJS/Bytecode/BasicBlock.h>
|
||||
#include <LibJS/Bytecode/Executable.h>
|
||||
#include <LibJS/Bytecode/RegexTable.h>
|
||||
#include <LibJS/JIT/Compiler.h>
|
||||
#include <LibJS/SourceCode.h>
|
||||
|
||||
namespace JS::Bytecode {
|
||||
@@ -52,4 +53,13 @@ void Executable::dump() const
|
||||
}
|
||||
}
|
||||
|
||||
JIT::NativeExecutable const* Executable::get_or_create_native_executable()
|
||||
{
|
||||
if (!m_did_try_jitting) {
|
||||
m_did_try_jitting = true;
|
||||
m_native_executable = JIT::Compiler::compile(*this);
|
||||
}
|
||||
return m_native_executable;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user