1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

LibJS: Store the bytecode accumulator in a dedicated physical register

We now use a dedicated physical register to store the bytecode
accumulator, instead of loading and storing it to the memory everytime.
This commit is contained in:
Idan Horowitz 2023-10-29 15:29:42 +02:00 committed by Andreas Kling
parent f9cab320e6
commit 38f3b78a1d
5 changed files with 163 additions and 129 deletions

View file

@ -37,6 +37,7 @@ private:
static constexpr auto STACK_POINTER = Assembler::Reg::RSP;
static constexpr auto REGISTER_ARRAY_BASE = Assembler::Reg::RBX;
static constexpr auto LOCALS_ARRAY_BASE = Assembler::Reg::R14;
static constexpr auto CACHED_ACCUMULATOR = Assembler::Reg::R13;
# endif
# define JS_ENUMERATE_COMMON_BINARY_OPS_WITHOUT_FAST_PATH(O) \
@ -153,6 +154,11 @@ private:
void store_vm_local(size_t, Assembler::Reg);
void load_vm_local(Assembler::Reg, size_t);
void reload_cached_accumulator();
void flush_cached_accumulator();
void load_accumulator(Assembler::Reg);
void store_accumulator(Assembler::Reg);
void compile_to_boolean(Assembler::Reg dst, Assembler::Reg src);
void check_exception();