Permalink
Browse files

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.
  • Loading branch information...
lioncash committed Jun 9, 2018
1 parent a3f2941 commit e18824e3f38b868ce0eee090e2575b67eef9d610
Showing with 2 additions and 3 deletions.
  1. +2 −3 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)

0 comments on commit e18824e

Please sign in to comment.