Skip to content

Commit

Permalink
pcsx2-ee: more cleaning of BaseBlockArray
Browse files Browse the repository at this point in the history
* Remove useless erase(first)
* Move reserve in private section
* if 0 GetByX86
  • Loading branch information
gregory38 committed Oct 30, 2015
1 parent 9c75c84 commit 2f0077a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
2 changes: 2 additions & 0 deletions pcsx2/x86/BaseblockEx.cpp
Expand Up @@ -45,6 +45,7 @@ int BaseBlocks::LastIndex(u32 startpc) const
return imin;
}

#if 0
BASEBLOCKEX* BaseBlocks::GetByX86(uptr ip)
{
if (0 == blocks.size())
Expand All @@ -67,6 +68,7 @@ BASEBLOCKEX* BaseBlocks::GetByX86(uptr ip)

return &blocks[imin];
}
#endif

void BaseBlocks::Link(u32 pc, s32* jumpptr)
{
Expand Down
26 changes: 8 additions & 18 deletions pcsx2/x86/BaseblockEx.h
Expand Up @@ -60,6 +60,12 @@ class BaseBlockArray {
blocks = newMem;
pxAssert(blocks != NULL);
}

void reserve(u32 size)
{
resize(size);
_Reserved = size;
}
public:
~BaseBlockArray()
{
Expand All @@ -80,6 +86,7 @@ class BaseBlockArray {
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) {
Expand All @@ -106,12 +113,6 @@ class BaseBlockArray {
return &blocks[imin];
}

void reserve(u32 size)
{
resize(size);
_Reserved = size;
}

__fi BASEBLOCKEX &operator[](int idx) const
{
return *(blocks + idx);
Expand All @@ -127,11 +128,6 @@ class BaseBlockArray {
return _Size;
}

__fi void erase(s32 first)
{
return erase(first, first + 1);
}

__fi void erase(s32 first, s32 last)
{
int range = last - first;
Expand Down Expand Up @@ -161,20 +157,14 @@ class BaseBlocks
{
}

BaseBlocks(uptr recompiler_) :
recompiler(recompiler_),
blocks(0x4000)
{
}

void SetJITCompile( void (*recompiler_)() )
{
recompiler = (uptr)recompiler_;
}

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
{
Expand Down
1 change: 1 addition & 0 deletions pcsx2/x86/ix86-32/iR5900-32.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 2f0077a

Please sign in to comment.