LibJIT+LibJS: Move JIT::Assembler into a new LibJIT library

This will allow other parts of the system to generate machine code
at runtime. :^)
This commit is contained in:
Andreas Kling 2023-10-26 15:18:28 +02:00
parent bfb527e614
commit 5b87d26027
Notes: sideshowbarker 2024-07-17 07:48:42 +09:00
7 changed files with 15 additions and 6 deletions

View file

@ -421,6 +421,7 @@ if (BUILD_LAGOM)
IMAP IMAP
ImageDecoderClient ImageDecoderClient
IPC IPC
JIT
JS JS
Line Line
Locale Locale

View file

@ -33,6 +33,7 @@ add_subdirectory(LibIDL)
add_subdirectory(LibIMAP) add_subdirectory(LibIMAP)
add_subdirectory(LibImageDecoderClient) add_subdirectory(LibImageDecoderClient)
add_subdirectory(LibIPC) add_subdirectory(LibIPC)
add_subdirectory(LibJIT)
add_subdirectory(LibJS) add_subdirectory(LibJS)
add_subdirectory(LibKeyboard) add_subdirectory(LibKeyboard)
add_subdirectory(LibLine) add_subdirectory(LibLine)

View file

@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-2-Clause * SPDX-License-Identifier: BSD-2-Clause
*/ */
#include <LibJS/JIT/Assembler.h> #include <LibJIT/Assembler.h>
namespace JS::JIT { namespace JIT {
} }

View file

@ -8,7 +8,7 @@
#include <AK/Vector.h> #include <AK/Vector.h>
namespace JS::JIT { namespace JIT {
struct Assembler { struct Assembler {
Assembler(Vector<u8>& output) Assembler(Vector<u8>& output)

View file

@ -0,0 +1,6 @@
set(SOURCES
Assembler.cpp
)
serenity_lib(LibJIT jit)
target_link_libraries(LibJIT PRIVATE LibCore)

View file

@ -24,7 +24,6 @@ set(SOURCES
Heap/Heap.cpp Heap/Heap.cpp
Heap/HeapBlock.cpp Heap/HeapBlock.cpp
Heap/MarkedVector.cpp Heap/MarkedVector.cpp
JIT/Assembler.cpp
JIT/Compiler.cpp JIT/Compiler.cpp
JIT/NativeExecutable.cpp JIT/NativeExecutable.cpp
Lexer.cpp Lexer.cpp
@ -268,4 +267,4 @@ set(SOURCES
) )
serenity_lib(LibJS js) serenity_lib(LibJS js)
target_link_libraries(LibJS PRIVATE LibCore LibCrypto LibFileSystem LibRegex LibSyntax LibLocale LibUnicode) target_link_libraries(LibJS PRIVATE LibCore LibCrypto LibFileSystem LibRegex LibSyntax LibLocale LibUnicode LibJIT)

View file

@ -6,13 +6,15 @@
#pragma once #pragma once
#include <LibJIT/Assembler.h>
#include <LibJS/Bytecode/Executable.h> #include <LibJS/Bytecode/Executable.h>
#include <LibJS/Bytecode/Op.h> #include <LibJS/Bytecode/Op.h>
#include <LibJS/JIT/Assembler.h>
#include <LibJS/JIT/NativeExecutable.h> #include <LibJS/JIT/NativeExecutable.h>
namespace JS::JIT { namespace JS::JIT {
using ::JIT::Assembler;
class Compiler { class Compiler {
public: public:
static OwnPtr<NativeExecutable> compile(Bytecode::Executable&); static OwnPtr<NativeExecutable> compile(Bytecode::Executable&);