mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-03 13:31:27 +12:00
LLVM: splitting and caching
This commit is contained in:
parent
4aab8db420
commit
0eb6bf6a67
11 changed files with 362 additions and 148 deletions
|
@ -31,10 +31,25 @@ class jit_compiler final
|
|||
// Compiled functions
|
||||
std::unordered_map<std::string, std::uintptr_t> m_map;
|
||||
|
||||
// Linkage cache
|
||||
std::unordered_map<std::string, std::uintptr_t> m_link;
|
||||
|
||||
// Arch
|
||||
std::string m_cpu;
|
||||
|
||||
// Internal
|
||||
void init();
|
||||
|
||||
public:
|
||||
jit_compiler(std::unique_ptr<llvm::Module>&&, std::unordered_map<std::string, std::uintptr_t>&&);
|
||||
jit_compiler(std::unordered_map<std::string, std::uintptr_t>);
|
||||
~jit_compiler();
|
||||
|
||||
// Compile module
|
||||
void make(std::unique_ptr<llvm::Module>, std::string);
|
||||
|
||||
// Load object
|
||||
void load(std::unique_ptr<llvm::Module>, std::unique_ptr<llvm::object::ObjectFile>);
|
||||
|
||||
// Get compiled function address
|
||||
std::uintptr_t get(const std::string& name) const
|
||||
{
|
||||
|
@ -47,6 +62,12 @@ public:
|
|||
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Get CPU info
|
||||
const std::string& cpu() const
|
||||
{
|
||||
return m_cpu;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue