From 9c0c672839f5079f628e3ec7ca5fe3771243eaa4 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 28 Oct 2023 19:25:26 +0200 Subject: [PATCH] LibJS/JIT: Store the VM register array base in RBX This allows us to use the displacement-less MOV encoding when accessing register $0 (the accumulator). This reduces code size by 158 KiB on Kraken/ai-astar.js :^) --- Userland/Libraries/LibJS/JIT/Compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibJS/JIT/Compiler.h b/Userland/Libraries/LibJS/JIT/Compiler.h index aad7567016..131dbe5a54 100644 --- a/Userland/Libraries/LibJS/JIT/Compiler.h +++ b/Userland/Libraries/LibJS/JIT/Compiler.h @@ -32,7 +32,7 @@ private: static constexpr auto ARG5 = Assembler::Reg::R9; static constexpr auto RET = Assembler::Reg::RAX; static constexpr auto STACK_POINTER = Assembler::Reg::RSP; - static constexpr auto REGISTER_ARRAY_BASE = Assembler::Reg::R13; + static constexpr auto REGISTER_ARRAY_BASE = Assembler::Reg::RBX; static constexpr auto LOCALS_ARRAY_BASE = Assembler::Reg::R14; static constexpr auto UNWIND_CONTEXT_BASE = Assembler::Reg::R15; # endif