mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-01-10 08:09:26 +01:00
JitCache: Return a pointer in AllocateBlock.
This commit is contained in:
parent
f14cebf079
commit
2d5288dc10
@ -140,8 +140,7 @@ void CachedInterpreter::Jit(u32 address)
|
||||
return;
|
||||
}
|
||||
|
||||
int block_num = m_block_cache.AllocateBlock(PC);
|
||||
JitBlock* b = m_block_cache.GetBlock(block_num);
|
||||
JitBlock* b = m_block_cache.AllocateBlock(PC);
|
||||
|
||||
js.blockStart = PC;
|
||||
js.firstFPInstructionFound = false;
|
||||
|
@ -589,8 +589,7 @@ void Jit64::Jit(u32 em_address)
|
||||
return;
|
||||
}
|
||||
|
||||
int block_num = blocks.AllocateBlock(em_address);
|
||||
JitBlock* b = blocks.GetBlock(block_num);
|
||||
JitBlock* b = blocks.AllocateBlock(em_address);
|
||||
blocks.FinalizeBlock(*b, jo.enableBlocklink, DoJit(em_address, &code_buffer, b, nextPC));
|
||||
}
|
||||
|
||||
|
@ -507,8 +507,7 @@ void JitIL::Jit(u32 em_address)
|
||||
return;
|
||||
}
|
||||
|
||||
int block_num = blocks.AllocateBlock(em_address);
|
||||
JitBlock* b = blocks.GetBlock(block_num);
|
||||
JitBlock* b = blocks.AllocateBlock(em_address);
|
||||
blocks.FinalizeBlock(*b, jo.enableBlocklink, DoJit(em_address, &code_buffer, b, nextPC));
|
||||
}
|
||||
|
||||
|
@ -398,8 +398,7 @@ void JitArm64::Jit(u32)
|
||||
return;
|
||||
}
|
||||
|
||||
int block_num = blocks.AllocateBlock(em_address);
|
||||
JitBlock* b = blocks.GetBlock(block_num);
|
||||
JitBlock* b = blocks.AllocateBlock(em_address);
|
||||
const u8* BlockPtr = DoJit(em_address, &code_buffer, b, nextPC);
|
||||
blocks.FinalizeBlock(*b, jo.enableBlocklink, BlockPtr);
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ int* JitBaseBlockCache::GetICache()
|
||||
return iCache.data();
|
||||
}
|
||||
|
||||
int JitBaseBlockCache::AllocateBlock(u32 em_address)
|
||||
JitBlock* JitBaseBlockCache::AllocateBlock(u32 em_address)
|
||||
{
|
||||
JitBlock& b = blocks[num_blocks];
|
||||
b.invalid = false;
|
||||
@ -128,7 +128,7 @@ int JitBaseBlockCache::AllocateBlock(u32 em_address)
|
||||
b.msrBits = MSR & JitBlock::JIT_CACHE_MSR_MASK;
|
||||
b.linkData.clear();
|
||||
num_blocks++; // commit the current block
|
||||
return num_blocks - 1;
|
||||
return &b;
|
||||
}
|
||||
|
||||
void JitBaseBlockCache::FinalizeBlock(JitBlock& b, bool block_link, const u8* code_ptr)
|
||||
|
@ -131,7 +131,7 @@ public:
|
||||
int GetNumBlocks() const;
|
||||
int* GetICache();
|
||||
|
||||
int AllocateBlock(u32 em_address);
|
||||
JitBlock* AllocateBlock(u32 em_address);
|
||||
void FinalizeBlock(JitBlock& b, bool block_link, const u8* code_ptr);
|
||||
|
||||
// Look for the block in the slow but accurate way.
|
||||
|
Loading…
x
Reference in New Issue
Block a user