mirror of https://github.com/PCSX2/pcsx2.git
Small speedup for the EE/IOP recompilers, by removing the legacy limit on the number of recompiled blocks (was causing recompilers to reset the code buffers way more than necessary).
git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1135 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
parent
002b9af006
commit
a7cbcae4be
|
@ -21,9 +21,6 @@
|
|||
|
||||
BASEBLOCKEX* BaseBlocks::New(u32 startpc, uptr fnptr)
|
||||
{
|
||||
if (blocks.size() == size)
|
||||
return 0;
|
||||
|
||||
BASEBLOCKEX newblock;
|
||||
std::vector<BASEBLOCKEX>::iterator iter;
|
||||
memset(&newblock, 0, sizeof newblock);
|
||||
|
|
|
@ -53,17 +53,15 @@ private:
|
|||
// switch to a hash map later?
|
||||
std::multimap<u32, uptr> links;
|
||||
typedef std::multimap<u32, uptr>::iterator linkiter_t;
|
||||
unsigned long size;
|
||||
uptr recompiler;
|
||||
std::vector<BASEBLOCKEX> blocks;
|
||||
|
||||
public:
|
||||
BaseBlocks(unsigned long size_, uptr recompiler_) :
|
||||
size(size_),
|
||||
BaseBlocks(uptr recompiler_) :
|
||||
recompiler(recompiler_),
|
||||
blocks(0)
|
||||
{
|
||||
blocks.reserve(size);
|
||||
blocks.reserve(0x4000);
|
||||
}
|
||||
|
||||
BASEBLOCKEX* New(u32 startpc, uptr fnptr);
|
||||
|
|
|
@ -51,7 +51,6 @@ uptr psxhwLUT[0x10000];
|
|||
|
||||
#define HWADDR(mem) (psxhwLUT[mem >> 16] + (mem))
|
||||
|
||||
#define PSX_NUMBLOCKS (1<<12)
|
||||
#define MAPBASE 0x48000000
|
||||
#define RECMEM_SIZE (8*1024*1024)
|
||||
|
||||
|
@ -63,7 +62,7 @@ static BASEBLOCK *recRAM = NULL; // and the ptr to the blocks here
|
|||
static BASEBLOCK *recROM = NULL; // and here
|
||||
static BASEBLOCK *recROM1 = NULL; // also here
|
||||
void iopJITCompile();
|
||||
static BaseBlocks recBlocks(PSX_NUMBLOCKS, (uptr)iopJITCompile);
|
||||
static BaseBlocks recBlocks((uptr)iopJITCompile);
|
||||
static u8 *recPtr = NULL;
|
||||
u32 psxpc; // recompiler psxpc
|
||||
int psxbranch; // set for branch
|
||||
|
@ -986,16 +985,8 @@ void iopRecRecompile(u32 startpc)
|
|||
|| s_pCurBlock->GetFnptr() == (uptr)iopJITCompileInBlock);
|
||||
|
||||
s_pCurBlockEx = recBlocks.Get(HWADDR(startpc));
|
||||
if(!s_pCurBlockEx || s_pCurBlockEx->startpc != HWADDR(startpc)) {
|
||||
if(!s_pCurBlockEx || s_pCurBlockEx->startpc != HWADDR(startpc))
|
||||
s_pCurBlockEx = recBlocks.New(HWADDR(startpc), (uptr)recPtr);
|
||||
|
||||
if( s_pCurBlockEx == NULL ) {
|
||||
DevCon::WriteLn("IOP Recompiler data reset");
|
||||
recResetIOP();
|
||||
x86SetPtr( recPtr );
|
||||
s_pCurBlockEx = recBlocks.New(HWADDR(startpc), (uptr)recPtr);
|
||||
}
|
||||
}
|
||||
|
||||
psxbranch = 0;
|
||||
|
||||
|
|
|
@ -76,7 +76,6 @@ u32 g_cpuHasConstReg = 0, g_cpuFlushedConstReg = 0;
|
|||
|
||||
#define X86
|
||||
static const int RECSTACK_SIZE = 0x00010000;
|
||||
static const int EE_NUMBLOCKS = (1<<15);
|
||||
|
||||
static u8 *recMem = NULL; // the recompiled blocks will be here
|
||||
static u8* recStack = NULL; // stack mem
|
||||
|
@ -85,7 +84,7 @@ static BASEBLOCK *recROM = NULL; // and here
|
|||
static BASEBLOCK *recROM1 = NULL; // also here
|
||||
static u32 *recRAMCopy = NULL;
|
||||
void JITCompile();
|
||||
static BaseBlocks recBlocks(EE_NUMBLOCKS, (uptr)JITCompile);
|
||||
static BaseBlocks recBlocks((uptr)JITCompile);
|
||||
static u8* recPtr = NULL, *recStackPtr = NULL;
|
||||
EEINST* s_pInstCache = NULL;
|
||||
static u32 s_nInstCacheSize = 0;
|
||||
|
@ -1283,13 +1282,6 @@ void recRecompile( const u32 startpc )
|
|||
|
||||
s_pCurBlockEx = recBlocks.New(HWADDR(startpc), (uptr)recPtr);
|
||||
|
||||
if( s_pCurBlockEx == NULL ) {
|
||||
//Console::WriteLn("ee reset (blocks)");
|
||||
recResetEE();
|
||||
x86SetPtr( recPtr );
|
||||
s_pCurBlockEx = recBlocks.New(HWADDR(startpc), (uptr)recPtr);
|
||||
}
|
||||
|
||||
assert(s_pCurBlockEx);
|
||||
|
||||
branch = 0;
|
||||
|
|
Loading…
Reference in New Issue