diff --git a/Core/MIPS/x86/Jit.cpp b/Core/MIPS/x86/Jit.cpp index edae212e3c..55ec5ec6fc 100644 --- a/Core/MIPS/x86/Jit.cpp +++ b/Core/MIPS/x86/Jit.cpp @@ -31,7 +31,7 @@ namespace MIPSComp { -static void JitBreakpoint() +void JitBreakpoint() { Core_EnableStepping(true); host->SetDebugMode(true); @@ -123,16 +123,10 @@ const u8 *Jit::DoJit(u32 em_address, JitBlock *b) u32 inst = Memory::Read_Instruction(js.compilerPC); js.downcountAmount += MIPSGetInstructionCycleEstimate(inst); - MIPSCompileOp(inst); - // Jit breakpoints are quite fast, so let's do them in release too. - if (CBreakPoints::IsAddressBreakPoint(js.compilerPC)) - { - FlushAll(); - MOV(32, M(&mips_->pc), Imm32(js.compilerPC)); - CALL(&JitBreakpoint); - WriteSyscallExit(); - } + CheckJitBreakpoint(js.compilerPC); + + MIPSCompileOp(inst); js.compilerPC += 4; numInstructions++; @@ -198,4 +192,19 @@ void Jit::WriteSyscallExit() JMP(asm_.dispatcherCheckCoreState, true); } +bool Jit::CheckJitBreakpoint(u32 addr) +{ + if (CBreakPoints::IsAddressBreakPoint(addr)) + { + FlushAll(); + MOV(32, M(&mips_->pc), Imm32(js.compilerPC)); + CALL(&JitBreakpoint); + WriteSyscallExit(); + + return true; + } + + return false; +} + } // namespace diff --git a/Core/MIPS/x86/Jit.h b/Core/MIPS/x86/Jit.h index 60f9f5ea60..b9ff726e6e 100644 --- a/Core/MIPS/x86/Jit.h +++ b/Core/MIPS/x86/Jit.h @@ -31,6 +31,9 @@ namespace MIPSComp { +// This is called when Jit hits a breakpoint. +void JitBreakpoint(); + struct JitOptions { JitOptions() @@ -103,6 +106,7 @@ private: void WriteExitDestInEAX(); // void WriteRfiExitDestInEAX(); void WriteSyscallExit(); + bool CheckJitBreakpoint(u32 addr); // Utility compilation functions void BranchFPFlag(u32 op, Gen::CCFlags cc, bool likely);