mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-01-15 08:23:17 -03:00
Jit64: Make TrampolineInfo smaller
Combined with the previous commit, this brings the TrampolineInfo struct down to 48 bytes. This matters, because Jit64 has a big std::unordered_map where it stores many megabytes of TrampolineInfo entries. The key saving comes from shrinking the len member from u32 to u16. It should be safe to even turn it into a u8, but going that far brings no additional savings due to how the padding works out.
This commit is contained in:
@@ -355,7 +355,7 @@ void EmuCodeBlock::SafeLoadToReg(X64Reg reg_value, const Gen::OpArg& opAddress,
|
||||
{
|
||||
NOP(padding);
|
||||
}
|
||||
info.len = static_cast<u32>(GetCodePtr() - info.start);
|
||||
info.len = static_cast<u16>(GetCodePtr() - info.start);
|
||||
|
||||
js.fastmemLoadStore = mov.address;
|
||||
return;
|
||||
@@ -527,7 +527,7 @@ void EmuCodeBlock::SafeWriteRegToReg(OpArg reg_value, X64Reg reg_addr, int acces
|
||||
{
|
||||
NOP(padding);
|
||||
}
|
||||
info.len = static_cast<u32>(GetCodePtr() - info.start);
|
||||
info.len = static_cast<u16>(GetCodePtr() - info.start);
|
||||
|
||||
js.fastmemLoadStore = mov.address;
|
||||
|
||||
|
||||
@@ -16,21 +16,7 @@ struct TrampolineInfo final
|
||||
u8* start = nullptr;
|
||||
|
||||
// The start + len = end of the store operation (points to the next instruction)
|
||||
u32 len = 0;
|
||||
|
||||
// The PPC PC for the current load/store block
|
||||
u32 pc = 0;
|
||||
|
||||
// Saved because we need these to make the ABI call in the trampoline
|
||||
BitSet32 registersInUse{};
|
||||
|
||||
// The MOV operation
|
||||
Gen::X64Reg nonAtomicSwapStoreSrc{};
|
||||
|
||||
// src/dest for load/store
|
||||
s32 offset = 0;
|
||||
Gen::X64Reg op_reg{};
|
||||
Gen::OpArg op_arg{};
|
||||
u16 len = 0;
|
||||
|
||||
// Original SafeLoadXXX/SafeStoreXXX flags
|
||||
u8 flags = 0;
|
||||
@@ -46,4 +32,18 @@ struct TrampolineInfo final
|
||||
|
||||
// Set to true if we added the offset to the address and need to undo it
|
||||
bool offsetAddedToAddress : 1 = false;
|
||||
|
||||
// The PPC PC for the current load/store block
|
||||
u32 pc = 0;
|
||||
|
||||
// Saved because we need these to make the ABI call in the trampoline
|
||||
BitSet32 registersInUse{};
|
||||
|
||||
// The MOV operation
|
||||
Gen::X64Reg nonAtomicSwapStoreSrc{};
|
||||
|
||||
// src/dest for load/store
|
||||
s32 offset = 0;
|
||||
Gen::X64Reg op_reg{};
|
||||
Gen::OpArg op_arg{};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user