diff --git a/Source/Core/Core/PowerPC/Jit64/RegCache/JitRegCache.cpp b/Source/Core/Core/PowerPC/Jit64/RegCache/JitRegCache.cpp index 57988fe4f3..3526d17894 100644 --- a/Source/Core/Core/PowerPC/Jit64/RegCache/JitRegCache.cpp +++ b/Source/Core/Core/PowerPC/Jit64/RegCache/JitRegCache.cpp @@ -622,6 +622,13 @@ RCForkGuard RegCache::Fork() return RCForkGuard{*this}; } +bool RegCache::IsAllUnlocked() const +{ + return std::none_of(m_regs.begin(), m_regs.end(), [](const auto& r){ return r.IsLocked(); }) && + std::none_of(m_xregs.begin(), m_xregs.end(), [](const auto& x){ return x.IsLocked(); }) && + !IsAnyConstraintActive(); +} + void RegCache::NewLock(preg_t preg) { m_regs[preg].Lock(); diff --git a/Source/Core/Core/PowerPC/Jit64/RegCache/JitRegCache.h b/Source/Core/Core/PowerPC/Jit64/RegCache/JitRegCache.h index 7196b3b41c..64040a5172 100644 --- a/Source/Core/Core/PowerPC/Jit64/RegCache/JitRegCache.h +++ b/Source/Core/Core/PowerPC/Jit64/RegCache/JitRegCache.h @@ -239,6 +239,8 @@ public: RCForkGuard Fork(); + bool IsAllUnlocked() const; + protected: friend class RCOpArg; friend class RCX64Reg;