From 2f0077a081a3141c269e151815389425291dcf7d Mon Sep 17 00:00:00 2001 From: Gregory Hainaut Date: Fri, 30 Oct 2015 19:03:34 +0100 Subject: [PATCH] pcsx2-ee: more cleaning of BaseBlockArray * Remove useless erase(first) * Move reserve in private section * if 0 GetByX86 --- pcsx2/x86/BaseblockEx.cpp | 2 ++ pcsx2/x86/BaseblockEx.h | 26 ++++++++------------------ pcsx2/x86/ix86-32/iR5900-32.cpp | 1 + 3 files changed, 11 insertions(+), 18 deletions(-) diff --git a/pcsx2/x86/BaseblockEx.cpp b/pcsx2/x86/BaseblockEx.cpp index 8414f1ef06..840b11369c 100644 --- a/pcsx2/x86/BaseblockEx.cpp +++ b/pcsx2/x86/BaseblockEx.cpp @@ -45,6 +45,7 @@ int BaseBlocks::LastIndex(u32 startpc) const return imin; } +#if 0 BASEBLOCKEX* BaseBlocks::GetByX86(uptr ip) { if (0 == blocks.size()) @@ -67,6 +68,7 @@ BASEBLOCKEX* BaseBlocks::GetByX86(uptr ip) return &blocks[imin]; } +#endif void BaseBlocks::Link(u32 pc, s32* jumpptr) { diff --git a/pcsx2/x86/BaseblockEx.h b/pcsx2/x86/BaseblockEx.h index 2cfebece52..8460bbf6c0 100644 --- a/pcsx2/x86/BaseblockEx.h +++ b/pcsx2/x86/BaseblockEx.h @@ -60,6 +60,12 @@ class BaseBlockArray { blocks = newMem; pxAssert(blocks != NULL); } + + void reserve(u32 size) + { + resize(size); + _Reserved = size; + } public: ~BaseBlockArray() { @@ -80,6 +86,7 @@ public: reserve(_Reserved + 0x2000); // some games requires even more! } + // Insert the the new BASEBLOCKEX by startpc order int imin = 0, imax = _Size, imid; while (imin < imax) { @@ -106,12 +113,6 @@ public: return &blocks[imin]; } - void reserve(u32 size) - { - resize(size); - _Reserved = size; - } - __fi BASEBLOCKEX &operator[](int idx) const { return *(blocks + idx); @@ -127,11 +128,6 @@ public: return _Size; } - __fi void erase(s32 first) - { - return erase(first, first + 1); - } - __fi void erase(s32 first, s32 last) { int range = last - first; @@ -161,12 +157,6 @@ public: { } - BaseBlocks(uptr recompiler_) : - recompiler(recompiler_), - blocks(0x4000) - { - } - void SetJITCompile( void (*recompiler_)() ) { recompiler = (uptr)recompiler_; @@ -174,7 +164,7 @@ public: BASEBLOCKEX* New(u32 startpc, uptr fnptr); int LastIndex (u32 startpc) const; - BASEBLOCKEX* GetByX86(uptr ip); + //BASEBLOCKEX* GetByX86(uptr ip); __fi int Index (u32 startpc) const { diff --git a/pcsx2/x86/ix86-32/iR5900-32.cpp b/pcsx2/x86/ix86-32/iR5900-32.cpp index d1b0ccbc7e..fd4ee86aac 100644 --- a/pcsx2/x86/ix86-32/iR5900-32.cpp +++ b/pcsx2/x86/ix86-32/iR5900-32.cpp @@ -881,6 +881,7 @@ void R5900::Dynarec::OpcodeImpl::recBREAK() //g_branch = 2; } +// Size is in dwords (4 bytes) void recClear(u32 addr, u32 size) { // necessary since recompiler doesn't call femms/emms