1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 01:15:08 +00:00
serenity/Userland/Libraries/LibJS/JIT/NativeExecutable.h
Andreas Kling 310bcd4717 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.
2023-10-27 19:07:22 +02:00

30 lines
524 B
C++

/*
* Copyright (c) 2023, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/Noncopyable.h>
#include <AK/Types.h>
#include <LibJS/Runtime/Completion.h>
namespace JS::JIT {
class NativeExecutable {
AK_MAKE_NONCOPYABLE(NativeExecutable);
AK_MAKE_NONMOVABLE(NativeExecutable);
public:
NativeExecutable(void* code, size_t size);
~NativeExecutable();
void run(VM&) const;
private:
void* m_code { nullptr };
size_t m_size { 0 };
};
}