mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-14 21:37:52 -07:00
CodeBlock: Add a shared IsAlmostFull function
This function shall keep care about the low watermark of code space. If we ran out of space, the JITs shall clear their block cache.
This commit is contained in:
parent
a5c10ded55
commit
6f38d1baa1
@ -72,5 +72,11 @@ public:
|
||||
{
|
||||
return region_size - (T::GetCodePtr() - region);
|
||||
}
|
||||
|
||||
bool IsAlmostFull() const
|
||||
{
|
||||
// This should be bigger than the biggest block ever.
|
||||
return GetSpaceLeft() < 0x10000;
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -490,9 +490,7 @@ void Jit64::Trace()
|
||||
|
||||
void Jit64::Jit(u32 em_address)
|
||||
{
|
||||
if (GetSpaceLeft() < 0x10000 ||
|
||||
farcode.GetSpaceLeft() < 0x10000 ||
|
||||
trampolines.GetSpaceLeft() < 0x10000 ||
|
||||
if (IsAlmostFull() || farcode.IsAlmostFull() || trampolines.IsAlmostFull() ||
|
||||
blocks.IsFull() ||
|
||||
SConfig::GetInstance().bJITNoBlockCache ||
|
||||
m_clear_cache_asap)
|
||||
|
@ -473,7 +473,7 @@ void JitIL::Trace()
|
||||
|
||||
void JitIL::Jit(u32 em_address)
|
||||
{
|
||||
if (GetSpaceLeft() < 0x10000 || farcode.GetSpaceLeft() < 0x10000 || blocks.IsFull() ||
|
||||
if (IsAlmostFull() || farcode.IsAlmostFull() || blocks.IsFull() ||
|
||||
SConfig::GetInstance().bJITNoBlockCache)
|
||||
{
|
||||
ClearCache();
|
||||
|
@ -279,8 +279,7 @@ void JitArm64::SingleStep()
|
||||
|
||||
void JitArm64::Jit(u32)
|
||||
{
|
||||
if (GetSpaceLeft() < 0x10000 || farcode.GetSpaceLeft() < 0x10000 || blocks.IsFull() ||
|
||||
SConfig::GetInstance().bJITNoBlockCache)
|
||||
if (IsAlmostFull() || farcode.IsAlmostFull() || blocks.IsFull() || SConfig::GetInstance().bJITNoBlockCache)
|
||||
{
|
||||
ClearCache();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user