Make sure the JitInterface's WriteProfileResults instruction pauses and resumes the CPU core.

This commit is contained in:
Ryan Houdek 2015-05-10 20:02:25 -05:00
parent 2fa29ae8bb
commit 0da086e389
1 changed files with 7 additions and 0 deletions

View File

@ -120,6 +120,10 @@ namespace JitInterface
if (!jit) if (!jit)
return; return;
PowerPC::CPUState old_state = PowerPC::GetState();
if (old_state == PowerPC::CPUState::CPU_RUNNING)
PowerPC::Pause();
std::vector<BlockStat> stats; std::vector<BlockStat> stats;
stats.reserve(jit->GetBlockCache()->GetNumBlocks()); stats.reserve(jit->GetBlockCache()->GetNumBlocks());
u64 cost_sum = 0; u64 cost_sum = 0;
@ -161,6 +165,9 @@ namespace JitInterface
(double)block->ticCounter*1000.0/(double)countsPerSec, block->codeSize); (double)block->ticCounter*1000.0/(double)countsPerSec, block->codeSize);
} }
} }
if (old_state == PowerPC::CPUState::CPU_RUNNING)
PowerPC::Start();
} }
bool HandleFault(uintptr_t access_address, SContext* ctx) bool HandleFault(uintptr_t access_address, SContext* ctx)
{ {