This will allow other parts of the system to generate machine code at runtime. :^)
@@ -421,6 +421,7 @@ if (BUILD_LAGOM)
IMAP
ImageDecoderClient
IPC
+ JIT
JS
Line
Locale
@@ -33,6 +33,7 @@ add_subdirectory(LibIDL)
add_subdirectory(LibIMAP)
add_subdirectory(LibImageDecoderClient)
add_subdirectory(LibIPC)
+add_subdirectory(LibJIT)
add_subdirectory(LibJS)
add_subdirectory(LibKeyboard)
add_subdirectory(LibLine)
@@ -4,8 +4,8 @@
* SPDX-License-Identifier: BSD-2-Clause
*/
-#include <LibJS/JIT/Assembler.h>
+#include <LibJIT/Assembler.h>
-namespace JS::JIT {
+namespace JIT {
}
@@ -8,7 +8,7 @@
#include <AK/Vector.h>
struct Assembler {
Assembler(Vector<u8>& output)
@@ -0,0 +1,6 @@
+set(SOURCES
+ Assembler.cpp
+)
+
+serenity_lib(LibJIT jit)
+target_link_libraries(LibJIT PRIVATE LibCore)
@@ -24,7 +24,6 @@ set(SOURCES
Heap/Heap.cpp
Heap/HeapBlock.cpp
Heap/MarkedVector.cpp
- JIT/Assembler.cpp
JIT/Compiler.cpp
JIT/NativeExecutable.cpp
Lexer.cpp
@@ -268,4 +267,4 @@ set(SOURCES
)
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)
@@ -6,13 +6,15 @@
#pragma once
#include <LibJS/Bytecode/Executable.h>
#include <LibJS/Bytecode/Op.h>
#include <LibJS/JIT/NativeExecutable.h>
namespace JS::JIT {
+using ::JIT::Assembler;
class Compiler {
public:
static OwnPtr<NativeExecutable> compile(Bytecode::Executable&);