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