mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:37:43 +00:00
LibJS/JIT: Stub out the JIT compiler on everything but ARCH(X86_64)
We don't support other architectures yet!
This commit is contained in:
parent
d1c701f79f
commit
a645b9c6c3
2 changed files with 100 additions and 81 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <AK/OwnPtr.h>
|
||||
#include <AK/Platform.h>
|
||||
#include <LibJS/Bytecode/CommonImplementations.h>
|
||||
#include <LibJS/Bytecode/Instruction.h>
|
||||
#include <LibJS/Bytecode/Interpreter.h>
|
||||
|
@ -17,6 +18,8 @@
|
|||
#include <sys/mman.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#if ARCH(X86_64)
|
||||
|
||||
# define LOG_JIT_SUCCESS 1
|
||||
# define LOG_JIT_FAILURE 1
|
||||
# define DUMP_JIT_MACHINE_CODE_TO_STDOUT 0
|
||||
|
@ -1088,3 +1091,5 @@ OwnPtr<NativeExecutable> Compiler::compile(Bytecode::Executable& bytecode_execut
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#if ARCH(X86_64)
|
||||
# include <LibJIT/Assembler.h>
|
||||
# include <LibJS/Bytecode/Executable.h>
|
||||
# include <LibJS/Bytecode/Op.h>
|
||||
|
@ -20,6 +21,7 @@ public:
|
|||
static OwnPtr<NativeExecutable> compile(Bytecode::Executable&);
|
||||
|
||||
private:
|
||||
# if ARCH(X86_64)
|
||||
static constexpr auto GPR0 = Assembler::Reg::RAX;
|
||||
static constexpr auto GPR1 = Assembler::Reg::RCX;
|
||||
static constexpr auto ARG0 = Assembler::Reg::RDI;
|
||||
|
@ -33,6 +35,7 @@ private:
|
|||
static constexpr auto REGISTER_ARRAY_BASE = Assembler::Reg::R13;
|
||||
static constexpr auto LOCALS_ARRAY_BASE = Assembler::Reg::R14;
|
||||
static constexpr auto UNWIND_CONTEXT_BASE = Assembler::Reg::R15;
|
||||
# endif
|
||||
|
||||
void compile_load_immediate(Bytecode::Op::LoadImmediate const&);
|
||||
void compile_load(Bytecode::Op::Load const&);
|
||||
|
@ -157,3 +160,14 @@ private:
|
|||
};
|
||||
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
namespace JS::JIT {
|
||||
class Compiler {
|
||||
public:
|
||||
static OwnPtr<NativeExecutable> compile(Bytecode::Executable&) { return nullptr; }
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue