backend/x64: Move spill from JitState onto the stack

This commit is contained in:
MerryMage
2021-05-04 14:15:35 +01:00
parent f8d8ea0deb
commit ddbc50cee0
11 changed files with 52 additions and 40 deletions

View File

@@ -13,6 +13,7 @@
#include "backend/x64/block_of_code.h"
#include "backend/x64/hostloc.h"
#include "backend/x64/perf_map.h"
#include "backend/x64/stack_layout.h"
#include "common/assert.h"
#include "common/bit_util.h"
@@ -155,7 +156,7 @@ void BlockOfCode::GenRunCode(std::function<void(BlockOfCode&)> rcp) {
// 1. It saves all the registers we as a callee need to save.
// 2. It aligns the stack so that the code the JIT emits can assume
// that the stack is appropriately aligned for CALLs.
ABI_PushCalleeSaveRegistersAndAdjustStack(*this);
ABI_PushCalleeSaveRegistersAndAdjustStack(*this, sizeof(StackLayout));
mov(r15, ABI_PARAM1);
mov(rbx, ABI_PARAM2); // save temporarily in non-volatile register
@@ -172,7 +173,7 @@ void BlockOfCode::GenRunCode(std::function<void(BlockOfCode&)> rcp) {
align();
step_code = getCurr<RunCodeFuncType>();
ABI_PushCalleeSaveRegistersAndAdjustStack(*this);
ABI_PushCalleeSaveRegistersAndAdjustStack(*this, sizeof(StackLayout));
mov(r15, ABI_PARAM1);
@@ -222,7 +223,7 @@ void BlockOfCode::GenRunCode(std::function<void(BlockOfCode&)> rcp) {
sub(param[0], qword[r15 + jsi.offsetof_cycles_remaining]);
});
ABI_PopCalleeSaveRegistersAndAdjustStack(*this);
ABI_PopCalleeSaveRegistersAndAdjustStack(*this, sizeof(StackLayout));
ret();
PerfMapRegister(run_code, getCurr(), "dynarmic_dispatcher");