mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
JIT.h: Add option for lowered function size
This commit is contained in:
parent
67f2356ef7
commit
3f4210437d
3 changed files with 6 additions and 6 deletions
|
@ -77,7 +77,7 @@ struct jit_runtime_base
|
||||||
jit_runtime_base& operator=(const jit_runtime_base&) = delete;
|
jit_runtime_base& operator=(const jit_runtime_base&) = delete;
|
||||||
|
|
||||||
const asmjit::Environment& environment() const noexcept;
|
const asmjit::Environment& environment() const noexcept;
|
||||||
void* _add(asmjit::CodeHolder* code) noexcept;
|
void* _add(asmjit::CodeHolder* code, usz align = 64) noexcept;
|
||||||
virtual uchar* _alloc(usz size, usz align) noexcept = 0;
|
virtual uchar* _alloc(usz size, usz align) noexcept = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -432,7 +432,7 @@ namespace asmjit
|
||||||
|
|
||||||
// Build runtime function with asmjit::X86Assembler
|
// Build runtime function with asmjit::X86Assembler
|
||||||
template <typename FT, typename Asm = native_asm, typename F>
|
template <typename FT, typename Asm = native_asm, typename F>
|
||||||
inline FT build_function_asm(std::string_view name, F&& builder, ::jit_runtime* custom_runtime = nullptr)
|
inline FT build_function_asm(std::string_view name, F&& builder, ::jit_runtime* custom_runtime = nullptr, bool reduced_size = false)
|
||||||
{
|
{
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
pthread_jit_write_protect_np(false);
|
pthread_jit_write_protect_np(false);
|
||||||
|
@ -484,7 +484,7 @@ inline FT build_function_asm(std::string_view name, F&& builder, ::jit_runtime*
|
||||||
compiler();
|
compiler();
|
||||||
}
|
}
|
||||||
|
|
||||||
const auto result = rt._add(&code);
|
const auto result = rt._add(&code, reduced_size ? 16 : 64);
|
||||||
jit_announce(result, code.codeSize(), name);
|
jit_announce(result, code.codeSize(), name);
|
||||||
return reinterpret_cast<FT>(uptr(result));
|
return reinterpret_cast<FT>(uptr(result));
|
||||||
}
|
}
|
||||||
|
|
|
@ -211,7 +211,7 @@ const asmjit::Environment& jit_runtime_base::environment() const noexcept
|
||||||
return g_env;
|
return g_env;
|
||||||
}
|
}
|
||||||
|
|
||||||
void* jit_runtime_base::_add(asmjit::CodeHolder* code) noexcept
|
void* jit_runtime_base::_add(asmjit::CodeHolder* code, usz align) noexcept
|
||||||
{
|
{
|
||||||
ensure(!code->flatten());
|
ensure(!code->flatten());
|
||||||
ensure(!code->resolveUnresolvedLinks());
|
ensure(!code->resolveUnresolvedLinks());
|
||||||
|
@ -219,7 +219,7 @@ void* jit_runtime_base::_add(asmjit::CodeHolder* code) noexcept
|
||||||
if (!codeSize)
|
if (!codeSize)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
auto p = ensure(this->_alloc(codeSize, 64));
|
auto p = ensure(this->_alloc(codeSize, align));
|
||||||
ensure(!code->relocateToBase(uptr(p)));
|
ensure(!code->relocateToBase(uptr(p)));
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
|
@ -4856,7 +4856,7 @@ bool ppu_initialize(const ppu_module<lv2_obj>& info, bool check_only, u64 file_s
|
||||||
// Execute LLE call
|
// Execute LLE call
|
||||||
c.br(call_target);
|
c.br(call_target);
|
||||||
#endif
|
#endif
|
||||||
}, runtime.get());
|
}, runtime.get(), true);
|
||||||
|
|
||||||
code_ptr = reinterpret_cast<u64>(func);
|
code_ptr = reinterpret_cast<u64>(func);
|
||||||
return code_ptr;
|
return code_ptr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue