CPU/Recompiler: Support block revalidation instead of flushing

This commit is contained in:
Connor McLaughlin
2019-11-22 00:32:40 +10:00
parent 7aafaeacbc
commit 9e82afac7b
4 changed files with 117 additions and 60 deletions

View File

@ -28,8 +28,8 @@ public:
void Reset();
void Execute();
/// Flushes all blocks which are in the range of the specified code page.
void FlushBlocksWithPageIndex(u32 page_index);
/// Invalidates all blocks which are in the range of the specified code page.
void InvalidateBlocksWithPageIndex(u32 page_index);
private:
using BlockMap = std::unordered_map<u32, CodeBlock*>;
@ -37,9 +37,12 @@ private:
void LogCurrentState();
CodeBlockKey GetNextBlockKey() const;
const CodeBlock* LookupBlock(CodeBlockKey key);
CodeBlock* LookupBlock(CodeBlockKey key);
bool RevalidateBlock(CodeBlock* block);
bool CompileBlock(CodeBlock* block);
void FlushBlock(CodeBlock* block);
void AddBlockToPageMap(CodeBlock* block);
void RemoveBlockFromPageMap(CodeBlock* block);
void InterpretCachedBlock(const CodeBlock& block);
void InterpretUncachedBlock();
@ -47,9 +50,6 @@ private:
Core* m_core;
Bus* m_bus;
const CodeBlock* m_current_block = nullptr;
bool m_current_block_flushed = false;
std::unique_ptr<JitCodeBuffer> m_code_buffer;
std::unique_ptr<Recompiler::ASMFunctions> m_asm_functions;