mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-25 15:19:42 -06:00
JitBase: Centralize location of code buffer
Given the code buffer is something truly common to all JIT implementations, we can centralize it in the base class and avoid duplicating it all over the place, while still allowing for differently sized buffers.
This commit is contained in:
@ -28,7 +28,9 @@ u32 Helper_Mask(u8 mb, u8 me)
|
||||
return mb > me ? ~mask : mask;
|
||||
}
|
||||
|
||||
JitBase::JitBase() = default;
|
||||
JitBase::JitBase() : m_code_buffer(code_buffer_size)
|
||||
{
|
||||
}
|
||||
|
||||
JitBase::~JitBase() = default;
|
||||
|
||||
|
@ -8,6 +8,7 @@
|
||||
//#define JIT_LOG_GPR // Enables logging of the PPC general purpose regs
|
||||
//#define JIT_LOG_FPR // Enables logging of the PPC floating point regs
|
||||
|
||||
#include <cstddef>
|
||||
#include <map>
|
||||
#include <unordered_set>
|
||||
|
||||
@ -102,6 +103,7 @@ protected:
|
||||
};
|
||||
|
||||
PPCAnalyst::CodeBlock code_block;
|
||||
PPCAnalyst::CodeBuffer m_code_buffer;
|
||||
PPCAnalyst::PPCAnalyzer analyzer;
|
||||
|
||||
bool CanMergeNextInstructions(int count) const;
|
||||
@ -109,10 +111,6 @@ protected:
|
||||
void UpdateMemoryOptions();
|
||||
|
||||
public:
|
||||
// This should probably be removed from public:
|
||||
JitOptions jo{};
|
||||
JitState js{};
|
||||
|
||||
JitBase();
|
||||
~JitBase() override;
|
||||
|
||||
@ -125,6 +123,12 @@ public:
|
||||
|
||||
virtual bool HandleFault(uintptr_t access_address, SContext* ctx) = 0;
|
||||
virtual bool HandleStackFault() { return false; }
|
||||
|
||||
static constexpr std::size_t code_buffer_size = 32000;
|
||||
|
||||
// This should probably be removed from public:
|
||||
JitOptions jo{};
|
||||
JitState js{};
|
||||
};
|
||||
|
||||
void JitTrampoline(JitBase& jit, u32 em_address);
|
||||
|
Reference in New Issue
Block a user