jit: Lock around changes to the jit pointer.

This commit is contained in:
Unknown W. Brackets committed 2021-11-28 10:04:22 -08:00
1 parent 0c6c2fb47a
commit b8ab7f39df
17 files changed
+87 -33

No files matched your search

+14 -12
View File
@@ -633,23 +633,25 @@ bool CBreakPoints::HasMemChecks()
return !memChecks_.empty();
}
void CBreakPoints::Update(u32 addr)
{
if (MIPSComp::jit)
{
void CBreakPoints::Update(u32 addr) {
if (MIPSComp::jit) {
bool resume = false;
if (Core_IsStepping() == false)
{
if (Core_IsStepping() == false) {
Core_EnableStepping(true, "cpu.breakpoint.update", addr);
Core_WaitInactive(200);
resume = true;
}
// In case this is a delay slot, clear the previous instruction too.
if (addr != 0)
MIPSComp::jit->InvalidateCacheAt(addr - 4, 8);
else
MIPSComp::jit->ClearCache();
{
std::lock_guard<std::recursive_mutex> guard(MIPSComp::jitLock);
if (MIPSComp::jit) {
// In case this is a delay slot, clear the previous instruction too.
if (addr != 0)
MIPSComp::jit->InvalidateCacheAt(addr - 4, 8);
else
MIPSComp::jit->ClearCache();
}
}
if (resume)
Core_EnableStepping(false);