mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
PPU LLVM: Reduce size of JIT-transition treampolines to 16
This commit is contained in:
parent
6fc643f483
commit
4c0832e6e6
3 changed files with 153 additions and 4 deletions
|
@ -93,6 +93,10 @@ struct jit_runtime final : jit_runtime_base
|
|||
// Allocate memory
|
||||
static u8* alloc(usz size, usz align, bool exec = true) noexcept;
|
||||
|
||||
// Allocate 0 bytes, observe memory location
|
||||
// Same as alloc(0, 1, exec)
|
||||
static u8* peek(bool exec = true) noexcept;
|
||||
|
||||
// Should be called at least once after global initialization
|
||||
static void initialize();
|
||||
|
||||
|
|
|
@ -147,6 +147,12 @@ static u8* add_jit_memory(usz size, usz align)
|
|||
return pointer;
|
||||
}
|
||||
|
||||
if (!size && align == 1)
|
||||
{
|
||||
// Return memory top address
|
||||
return pointer + (Ctr.load() & 0xffff'ffff);
|
||||
}
|
||||
|
||||
u64 olda, newa;
|
||||
|
||||
// Simple allocation by incrementing pointer to the next free data
|
||||
|
@ -273,6 +279,18 @@ u8* jit_runtime::alloc(usz size, usz align, bool exec) noexcept
|
|||
}
|
||||
}
|
||||
|
||||
u8* jit_runtime::peek(bool exec) noexcept
|
||||
{
|
||||
if (exec)
|
||||
{
|
||||
return add_jit_memory<s_code_pos, 0x0, utils::protection::wx>(0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
return add_jit_memory<s_data_pos, 0x40000000, utils::protection::rw>(0, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void jit_runtime::initialize()
|
||||
{
|
||||
if (!s_code_init.empty() || !s_data_init.empty())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue