diff --git a/src/core/arm/jit_x64/interface.cpp b/src/core/arm/jit_x64/interface.cpp index bf4844145..df5d9b27e 100644 --- a/src/core/arm/jit_x64/interface.cpp +++ b/src/core/arm/jit_x64/interface.cpp @@ -217,9 +217,9 @@ void ARM_Jit::PrepareReschedule() { } void ARM_Jit::ClearCache() { - UNIMPLEMENTED(); - // compiler.ClearCache(); - this->state->cpu_state.instruction_cache.clear(); + compiler.ClearCache(); + block_of_code.ClearCodeSpace(); + state->cpu_state.instruction_cache.clear(); } } diff --git a/src/core/arm/jit_x64/interface.h b/src/core/arm/jit_x64/interface.h index 4d91309fe..228dc4ac5 100644 --- a/src/core/arm/jit_x64/interface.h +++ b/src/core/arm/jit_x64/interface.h @@ -40,7 +40,7 @@ public: void PrepareReschedule() override; void ExecuteInstructions(int num_instructions) override; - void ClearCache(); + void ClearCache() override; private: bool reschedule; diff --git a/src/core/arm/jit_x64/jit_x64.cpp b/src/core/arm/jit_x64/jit_x64.cpp index d35da5b31..b36690df2 100644 --- a/src/core/arm/jit_x64/jit_x64.cpp +++ b/src/core/arm/jit_x64/jit_x64.cpp @@ -2,6 +2,7 @@ // Licensed under GPLv2 or any later version // Refer to the license.txt file included. +#include "core/arm/dyncom/arm_dyncom_interpreter.h" #include "core/arm/jit_x64/jit_x64.h" #include "core/memory.h" @@ -11,6 +12,12 @@ using namespace Gen; JitX64::JitX64(XEmitter* code_) : code(code_) {} +void JitX64::ClearCache() { + basic_blocks.clear(); + patch_jmp_locations.clear(); + InterpreterClearCache(); +} + CodePtr JitX64::GetBB(u32 pc, bool TFlag, bool EFlag) { const LocationDescriptor desc = { pc, TFlag, EFlag }; diff --git a/src/core/arm/jit_x64/jit_x64.h b/src/core/arm/jit_x64/jit_x64.h index 9262d7913..336c599e7 100644 --- a/src/core/arm/jit_x64/jit_x64.h +++ b/src/core/arm/jit_x64/jit_x64.h @@ -48,6 +48,8 @@ public: JitX64(Gen::XEmitter* code_); virtual ~JitX64() override {} + void ClearCache(); + CodePtr GetBB(u32 pc, bool TFlag, bool EFlag); /// Returns a pointer to the compiled basic block.