Permalink
Browse files

JitRegCache: Count locks/unlocks

  • Loading branch information...
MerryMage committed Oct 15, 2018
1 parent 2dce7e6 commit 448fc89e4c6b76685f7ad6c745a8386640fcc4df
Showing with 20 additions and 10 deletions.
  1. +2 −2 Source/Core/Core/PowerPC/Jit64/JitRegCache.cpp
  2. +18 −8 Source/Core/Core/PowerPC/Jit64/JitRegCache.h
@@ -212,13 +212,13 @@ X64Reg RegCache::RX(preg_t preg) const
void RegCache::UnlockAll()
{
for (auto& reg : m_regs)
reg.Unlock();
reg.UnlockAll();
}
void RegCache::UnlockAllX()
{
for (auto& xreg : m_xregs)
xreg.Unlock();
xreg.UnlockAll();
}
bool RegCache::IsFreeX(size_t xreg) const
@@ -75,15 +75,20 @@ class PPCCachedReg
location = Gen::Imm32(imm32);
}
bool IsLocked() const { return locked; }
void Lock() { locked = true; }
void Unlock() { locked = false; }
bool IsLocked() const { return locked > 0; }
void Lock() { locked++; }
void Unlock()
{
ASSERT(IsLocked());
locked--;
}
void UnlockAll() { locked = 0; } // TODO: Remove from final version
private:
Gen::OpArg default_location{};
Gen::OpArg location{};
bool away = false; // value not in source register
bool locked = false;
size_t locked = 0;
};
class X64CachedReg
@@ -110,15 +115,20 @@ class X64CachedReg
bool IsDirty() const { return dirty; }
void MakeDirty() { dirty = true; }
bool IsLocked() const { return locked; }
void Lock() { locked = true; }
void Unlock() { locked = false; }
bool IsLocked() const { return locked > 0; }
void Lock() { locked++; }
void Unlock()
{
ASSERT(IsLocked());
locked--;
}
void UnlockAll() { locked = 0; } // TODO: Remove from final version
private:
preg_t ppcReg = static_cast<preg_t>(Gen::INVALID_REG);
bool free = true;
bool dirty = false;
bool locked = false;
size_t locked = 0;
};
class RegCache

0 comments on commit 448fc89

Please sign in to comment.