mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Fastmem: increase the size of trampoline cache in MMU mode, check space
Fastmem in MMU mode generates way more trampolines than normal, so we need a bunch more space too, lest we run out of room.
This commit is contained in:
@ -183,7 +183,7 @@ void Jit64::Init()
|
|||||||
gpr.SetEmitter(this);
|
gpr.SetEmitter(this);
|
||||||
fpr.SetEmitter(this);
|
fpr.SetEmitter(this);
|
||||||
|
|
||||||
trampolines.Init();
|
trampolines.Init(js.memcheck ? TRAMPOLINE_CODE_SIZE_MMU : TRAMPOLINE_CODE_SIZE);
|
||||||
AllocCodeSpace(CODE_SIZE);
|
AllocCodeSpace(CODE_SIZE);
|
||||||
|
|
||||||
// BLR optimization has the same consequences as block linking, as well as
|
// BLR optimization has the same consequences as block linking, as well as
|
||||||
@ -494,6 +494,7 @@ void Jit64::Jit(u32 em_address)
|
|||||||
{
|
{
|
||||||
if (GetSpaceLeft() < 0x10000 ||
|
if (GetSpaceLeft() < 0x10000 ||
|
||||||
farcode.GetSpaceLeft() < 0x10000 ||
|
farcode.GetSpaceLeft() < 0x10000 ||
|
||||||
|
trampolines.GetSpaceLeft() < 0x10000 ||
|
||||||
blocks.IsFull() ||
|
blocks.IsFull() ||
|
||||||
SConfig::GetInstance().m_LocalCoreStartupParameter.bJITNoBlockCache ||
|
SConfig::GetInstance().m_LocalCoreStartupParameter.bJITNoBlockCache ||
|
||||||
m_clear_cache_asap)
|
m_clear_cache_asap)
|
||||||
|
@ -249,7 +249,7 @@ void JitIL::Init()
|
|||||||
jo.accurateSinglePrecision = false;
|
jo.accurateSinglePrecision = false;
|
||||||
js.memcheck = SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU;
|
js.memcheck = SConfig::GetInstance().m_LocalCoreStartupParameter.bMMU;
|
||||||
|
|
||||||
trampolines.Init();
|
trampolines.Init(js.memcheck ? TRAMPOLINE_CODE_SIZE_MMU : TRAMPOLINE_CODE_SIZE);
|
||||||
AllocCodeSpace(CODE_SIZE);
|
AllocCodeSpace(CODE_SIZE);
|
||||||
blocks.Init();
|
blocks.Init();
|
||||||
asm_routines.Init(nullptr);
|
asm_routines.Init(nullptr);
|
||||||
|
@ -42,6 +42,10 @@ static const int CODE_SIZE = 1024 * 1024 * 32;
|
|||||||
static const int FARCODE_SIZE = 1024 * 1024 * 8;
|
static const int FARCODE_SIZE = 1024 * 1024 * 8;
|
||||||
static const int FARCODE_SIZE_MMU = 1024 * 1024 * 48;
|
static const int FARCODE_SIZE_MMU = 1024 * 1024 * 48;
|
||||||
|
|
||||||
|
// same for the trampoline code cache, because fastmem results in far more backpatches in MMU mode
|
||||||
|
static const int TRAMPOLINE_CODE_SIZE = 1024 * 1024 * 8;
|
||||||
|
static const int TRAMPOLINE_CODE_SIZE_MMU = 1024 * 1024 * 32;
|
||||||
|
|
||||||
// Like XCodeBlock but has some utilities for memory access.
|
// Like XCodeBlock but has some utilities for memory access.
|
||||||
class EmuCodeBlock : public Gen::X64CodeBlock
|
class EmuCodeBlock : public Gen::X64CodeBlock
|
||||||
{
|
{
|
||||||
|
@ -19,9 +19,9 @@
|
|||||||
|
|
||||||
using namespace Gen;
|
using namespace Gen;
|
||||||
|
|
||||||
void TrampolineCache::Init()
|
void TrampolineCache::Init(int size)
|
||||||
{
|
{
|
||||||
AllocCodeSpace(8 * 1024 * 1024);
|
AllocCodeSpace(size);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TrampolineCache::ClearCodeSpace()
|
void TrampolineCache::ClearCodeSpace()
|
||||||
|
@ -17,7 +17,7 @@ const int BACKPATCH_SIZE = 5;
|
|||||||
class TrampolineCache : public Gen::X64CodeBlock
|
class TrampolineCache : public Gen::X64CodeBlock
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
void Init();
|
void Init(int size);
|
||||||
void Shutdown();
|
void Shutdown();
|
||||||
|
|
||||||
const u8* GenerateReadTrampoline(const InstructionInfo &info, BitSet32 registersInUse, u8* exceptionHandler, u8* returnPtr);
|
const u8* GenerateReadTrampoline(const InstructionInfo &info, BitSet32 registersInUse, u8* exceptionHandler, u8* returnPtr);
|
||||||
|
Reference in New Issue
Block a user