diff --git a/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp b/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp index 71143fc955..2c9a4afeb5 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp +++ b/Source/Core/Core/PowerPC/JitCommon/JitCache.cpp @@ -116,24 +116,6 @@ using namespace Gen; memset(blockCodePointers, 0, sizeof(u8*)*MAX_NUM_BLOCKS); } - void JitBaseBlockCache::ClearSafe() - { - memset(iCache, JIT_ICACHE_INVALID_BYTE, JIT_ICACHE_SIZE); - memset(iCacheEx, JIT_ICACHE_INVALID_BYTE, JIT_ICACHEEX_SIZE); - memset(iCacheVMEM, JIT_ICACHE_INVALID_BYTE, JIT_ICACHE_SIZE); - } - - /*void JitBaseBlockCache::DestroyBlocksWithFlag(BlockFlag death_flag) - { - for (int i = 0; i < num_blocks; i++) - { - if (blocks[i].flags & death_flag) - { - DestroyBlock(i, false); - } - } - }*/ - void JitBaseBlockCache::Reset() { Shutdown(); diff --git a/Source/Core/Core/PowerPC/JitCommon/JitCache.h b/Source/Core/Core/PowerPC/JitCommon/JitCache.h index 0837dd371a..ada410a420 100644 --- a/Source/Core/Core/PowerPC/JitCommon/JitCache.h +++ b/Source/Core/Core/PowerPC/JitCommon/JitCache.h @@ -96,7 +96,6 @@ public: void FinalizeBlock(int block_num, bool block_link, const u8 *code_ptr); void Clear(); - void ClearSafe(); void Init(); void Shutdown(); void Reset(); @@ -122,9 +121,6 @@ public: // DOES NOT WORK CORRECTLY WITH INLINING void InvalidateICache(u32 address, const u32 length); void DestroyBlock(int block_num, bool invalidate); - - // Not currently used - //void DestroyBlocksWithFlag(BlockFlag death_flag); }; // x86 BlockCache diff --git a/Source/Core/Core/PowerPC/JitInterface.cpp b/Source/Core/Core/PowerPC/JitInterface.cpp index 281f853911..f959564d51 100644 --- a/Source/Core/Core/PowerPC/JitInterface.cpp +++ b/Source/Core/Core/PowerPC/JitInterface.cpp @@ -39,7 +39,7 @@ namespace JitInterface void DoState(PointerWrap &p) { if (jit && p.GetMode() == PointerWrap::MODE_READ) - jit->GetBlockCache()->ClearSafe(); + jit->GetBlockCache()->Clear(); } CPUCoreBase *InitJitCore(int core) { @@ -199,8 +199,12 @@ namespace JitInterface } void ClearSafe() { + // This clear is "safe" in the sense that it's okay to run from + // inside a JIT'ed block: it clears the instruction cache, but not + // the JIT'ed code. + // TODO: There's probably a better way to handle this situation. if (jit) - jit->GetBlockCache()->ClearSafe(); + jit->GetBlockCache()->Clear(); } void InvalidateICache(u32 address, u32 size)