JitRegCache: IsAllUnlocked

This commit is contained in:
MerryMage 2018-10-15 21:00:51 +01:00
parent 6c61d9a426
commit 16f8b7413d
2 changed files with 9 additions and 0 deletions

View File

@ -622,6 +622,13 @@ RCForkGuard RegCache::Fork()
return RCForkGuard{*this}; 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) void RegCache::NewLock(preg_t preg)
{ {
m_regs[preg].Lock(); m_regs[preg].Lock();

View File

@ -239,6 +239,8 @@ public:
RCForkGuard Fork(); RCForkGuard Fork();
bool IsAllUnlocked() const;
protected: protected:
friend class RCOpArg; friend class RCOpArg;
friend class RCX64Reg; friend class RCX64Reg;