1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 07:48:12 +00:00

LibJS/JIT: Make Assembler::Reg represent X86 registers

And move the generic register aliases to JIT::Compiler.
This commit is contained in:
Andreas Kling 2023-10-16 15:21:31 +02:00
parent f9041c7b31
commit acece9057e
3 changed files with 53 additions and 40 deletions

View file

@ -18,6 +18,15 @@ public:
static OwnPtr<NativeExecutable> compile(Bytecode::Executable const&);
private:
static constexpr auto GPR0 = Assembler::Reg::RAX;
static constexpr auto GPR1 = Assembler::Reg::RCX;
static constexpr auto ARG0 = Assembler::Reg::RDI;
static constexpr auto ARG1 = Assembler::Reg::RSI;
static constexpr auto ARG2 = Assembler::Reg::RDX;
static constexpr auto RET = Assembler::Reg::RAX;
static constexpr auto REGISTER_ARRAY_BASE = Assembler::Reg::R8;
static constexpr auto LOCALS_ARRAY_BASE = Assembler::Reg::R9;
void compile_load_immediate(Bytecode::Op::LoadImmediate const&);
void compile_load(Bytecode::Op::Load const&);
void compile_store(Bytecode::Op::Store const&);