From e18824e3f38b868ce0eee090e2575b67eef9d610 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Sat, 9 Jun 2018 08:13:49 -0400 Subject: [PATCH] PPCAnalyst: get rid of code buffer size variable Rather than have a separate independent variable that we need to keep track of in conjunction with the JIT code buffer size itself, amend the analyst code to use the code buffer constant in JitBase. Now if the size ever changes, then the analyst will automatically adjust to handle it. --- Source/Core/Core/PowerPC/PPCAnalyst.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/PowerPC/PPCAnalyst.cpp b/Source/Core/Core/PowerPC/PPCAnalyst.cpp index 3955f454b8..b65108f7a8 100644 --- a/Source/Core/Core/PowerPC/PPCAnalyst.cpp +++ b/Source/Core/Core/PowerPC/PPCAnalyst.cpp @@ -15,6 +15,7 @@ #include "Common/Logging/Log.h" #include "Common/StringUtil.h" #include "Core/ConfigManager.h" +#include "Core/PowerPC/JitCommon/JitBase.h" #include "Core/PowerPC/MMU.h" #include "Core/PowerPC/PPCSymbolDB.h" #include "Core/PowerPC/PPCTables.h" @@ -35,8 +36,6 @@ namespace PPCAnalyst { -constexpr int CODEBUFFER_SIZE = 32000; - // 0 does not perform block merging constexpr u32 BRANCH_FOLLOWING_THRESHOLD = 2; @@ -90,7 +89,7 @@ bool AnalyzeFunction(u32 startAddr, Common::Symbol& func, u32 max_size) for (u32 addr = startAddr; true; addr += 4) { func.size += 4; - if (func.size >= CODEBUFFER_SIZE * 4 || !PowerPC::HostIsInstructionRAMAddress(addr)) // weird + if (func.size >= JitBase::code_buffer_size * 4 || !PowerPC::HostIsInstructionRAMAddress(addr)) return false; if (max_size && func.size > max_size)