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:
Lioncash committed 2018-06-09 08:16:53 -04:00
1 parent 48b7cfa75c
commit a3f2941173
8 files changed
+44 -28

No files matched your search

@@ -48,9 +48,7 @@ struct CachedInterpreter::Instruction
Type type = Type::Abort;
};
CachedInterpreter::CachedInterpreter() : code_buffer(32000)
{
}
CachedInterpreter::CachedInterpreter() = default;
CachedInterpreter::~CachedInterpreter() = default;
@@ -194,7 +192,7 @@ void CachedInterpreter::Jit(u32 address)
ClearCache();
}
const u32 nextPC = analyzer.Analyze(PC, &code_block, &code_buffer, code_buffer.size());
const u32 nextPC = analyzer.Analyze(PC, &code_block, &m_code_buffer, m_code_buffer.size());
if (code_block.m_memory_exception)
{
// Address of instruction could not be translated
@@ -218,7 +216,7 @@ void CachedInterpreter::Jit(u32 address)
for (u32 i = 0; i < code_block.m_num_instructions; i++)
{
PPCAnalyst::CodeOp& op = code_buffer[i];
PPCAnalyst::CodeOp& op = m_code_buffer[i];
js.downcountAmount += op.opinfo->numCycles;
@@ -42,5 +42,4 @@ private:
BlockCache m_block_cache{*this};
std::vector<Instruction> m_code;
PPCAnalyst::CodeBuffer code_buffer;
};