mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-10 05:28:56 +02:00
force ankerl + fixup for OO with prelude commits
This commit is contained in:
parent
745a12b3d1
commit
58499f5fc1
5 changed files with 68 additions and 9 deletions
21
.patch/xbyak/0001-macro-stl.patch
Normal file
21
.patch/xbyak/0001-macro-stl.patch
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h
|
||||||
|
index ed7706a..51b520d 100644
|
||||||
|
--- a/xbyak/xbyak.h
|
||||||
|
+++ b/xbyak/xbyak.h
|
||||||
|
@@ -37,6 +37,7 @@
|
||||||
|
#define XBYAK_GNUC_PREREQ(major, minor) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#if !defined(XBYAK_STD_UNORDERED_SET)
|
||||||
|
// This covers -std=(gnu|c)++(0x|11|1y), -stdlib=libc++, and modern Microsoft.
|
||||||
|
#if ((defined(_MSC_VER) && (_MSC_VER >= 1600)) || defined(_LIBCPP_VERSION) ||\
|
||||||
|
((__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)))
|
||||||
|
@@ -71,6 +72,8 @@
|
||||||
|
#define XBYAK_STD_UNORDERED_MAP std::map
|
||||||
|
#define XBYAK_STD_UNORDERED_MULTIMAP std::multimap
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#ifdef _WIN32
|
||||||
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
21
.patch/xbyak_sun/0001-macro-stl.patch
Normal file
21
.patch/xbyak_sun/0001-macro-stl.patch
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
diff --git a/xbyak/xbyak.h b/xbyak/xbyak.h
|
||||||
|
index ed7706a..51b520d 100644
|
||||||
|
--- a/xbyak/xbyak.h
|
||||||
|
+++ b/xbyak/xbyak.h
|
||||||
|
@@ -37,6 +37,7 @@
|
||||||
|
#define XBYAK_GNUC_PREREQ(major, minor) 0
|
||||||
|
#endif
|
||||||
|
|
||||||
|
+#if !defined(XBYAK_STD_UNORDERED_SET)
|
||||||
|
// This covers -std=(gnu|c)++(0x|11|1y), -stdlib=libc++, and modern Microsoft.
|
||||||
|
#if ((defined(_MSC_VER) && (_MSC_VER >= 1600)) || defined(_LIBCPP_VERSION) ||\
|
||||||
|
((__cplusplus >= 201103) || defined(__GXX_EXPERIMENTAL_CXX0X__)))
|
||||||
|
@@ -71,6 +72,8 @@
|
||||||
|
#define XBYAK_STD_UNORDERED_MAP std::map
|
||||||
|
#define XBYAK_STD_UNORDERED_MULTIMAP std::multimap
|
||||||
|
#endif
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
#ifdef _WIN32
|
||||||
|
#ifndef WIN32_LEAN_AND_MEAN
|
||||||
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
|
@ -203,7 +203,7 @@ void ArmDynarmic32::MakeJit(Common::PageTable* page_table) {
|
||||||
|
|
||||||
// Code cache size
|
// Code cache size
|
||||||
#if defined(__OPENORBIS__)
|
#if defined(__OPENORBIS__)
|
||||||
config.code_cache_size = std::uint32_t(8_MiB);
|
config.code_cache_size = std::uint32_t(32_MiB);
|
||||||
#elif defined(ARCHITECTURE_arm64) || defined(__sun__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
|
#elif defined(ARCHITECTURE_arm64) || defined(__sun__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
|
||||||
config.code_cache_size = std::uint32_t(128_MiB);
|
config.code_cache_size = std::uint32_t(128_MiB);
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -255,7 +255,7 @@ void ArmDynarmic64::MakeJit(Common::PageTable* page_table, std::size_t address_s
|
||||||
|
|
||||||
// Code cache size
|
// Code cache size
|
||||||
#if defined(__OPENORBIS__)
|
#if defined(__OPENORBIS__)
|
||||||
config.code_cache_size = std::uint32_t(8_MiB);
|
config.code_cache_size = std::uint32_t(32_MiB);
|
||||||
#elif defined(ARCHITECTURE_arm64) || defined(__sun__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
|
#elif defined(ARCHITECTURE_arm64) || defined(__sun__) || defined(__NetBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
|
||||||
config.code_cache_size = std::uint32_t(128_MiB);
|
config.code_cache_size = std::uint32_t(128_MiB);
|
||||||
#else
|
#else
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,13 @@ const std::array<Xbyak::Reg64, ABI_PARAM_COUNT> BlockOfCode::ABI_PARAMS = {Block
|
||||||
|
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
#ifdef __OPENORBIS__
|
||||||
|
constexpr size_t CONSTANT_POOL_SIZE = 8 * 4096;
|
||||||
|
constexpr size_t PRELUDE_COMMIT_SIZE = 8 * 4096;
|
||||||
|
#else
|
||||||
constexpr size_t CONSTANT_POOL_SIZE = 2 * 1024 * 1024;
|
constexpr size_t CONSTANT_POOL_SIZE = 2 * 1024 * 1024;
|
||||||
constexpr size_t PRELUDE_COMMIT_SIZE = 16 * 1024 * 1024;
|
constexpr size_t PRELUDE_COMMIT_SIZE = 16 * 1024 * 1024;
|
||||||
|
#endif
|
||||||
|
|
||||||
class CustomXbyakAllocator : public Xbyak::Allocator {
|
class CustomXbyakAllocator : public Xbyak::Allocator {
|
||||||
public:
|
public:
|
||||||
|
|
@ -67,8 +72,12 @@ public:
|
||||||
uint8_t* alloc(size_t size) override {
|
uint8_t* alloc(size_t size) override {
|
||||||
void* p = VirtualAlloc(nullptr, size, MEM_RESERVE, PAGE_READWRITE);
|
void* p = VirtualAlloc(nullptr, size, MEM_RESERVE, PAGE_READWRITE);
|
||||||
if (p == nullptr) {
|
if (p == nullptr) {
|
||||||
|
#ifndef XBYAK_NO_EXCEPTION
|
||||||
using Xbyak::Error;
|
using Xbyak::Error;
|
||||||
XBYAK_THROW(Xbyak::ERR_CANT_ALLOC);
|
XBYAK_THROW(Xbyak::ERR_CANT_ALLOC);
|
||||||
|
#else
|
||||||
|
std::abort();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
return static_cast<uint8_t*>(p);
|
return static_cast<uint8_t*>(p);
|
||||||
}
|
}
|
||||||
|
|
@ -106,8 +115,12 @@ public:
|
||||||
#endif
|
#endif
|
||||||
void* p = mmap(nullptr, size, prot, mode, -1, 0);
|
void* p = mmap(nullptr, size, prot, mode, -1, 0);
|
||||||
if (p == MAP_FAILED) {
|
if (p == MAP_FAILED) {
|
||||||
|
#ifndef XBYAK_NO_EXCEPTION
|
||||||
using Xbyak::Error;
|
using Xbyak::Error;
|
||||||
XBYAK_THROW(Xbyak::ERR_CANT_ALLOC);
|
XBYAK_THROW(Xbyak::ERR_CANT_ALLOC);
|
||||||
|
#else
|
||||||
|
std::abort();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
std::memcpy(p, &size, sizeof(size_t));
|
std::memcpy(p, &size, sizeof(size_t));
|
||||||
return static_cast<uint8_t*>(p) + DYNARMIC_PAGE_SIZE;
|
return static_cast<uint8_t*>(p) + DYNARMIC_PAGE_SIZE;
|
||||||
|
|
@ -233,14 +246,14 @@ bool IsUnderRosetta() {
|
||||||
|
|
||||||
} // anonymous namespace
|
} // anonymous namespace
|
||||||
|
|
||||||
#ifdef DYNARMIC_ENABLE_NO_EXECUTE_SUPPORT
|
|
||||||
static const auto default_cg_mode = Xbyak::DontSetProtectRWE;
|
|
||||||
#else
|
|
||||||
static const auto default_cg_mode = nullptr; //Allow RWE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
BlockOfCode::BlockOfCode(RunCodeCallbacks cb, JitStateInfo jsi, size_t total_code_size, std::function<void(BlockOfCode&)> rcp) noexcept
|
BlockOfCode::BlockOfCode(RunCodeCallbacks cb, JitStateInfo jsi, size_t total_code_size, std::function<void(BlockOfCode&)> rcp) noexcept
|
||||||
: Xbyak::CodeGenerator(total_code_size, default_cg_mode, &s_allocator)
|
#ifdef __OPENORBIS__
|
||||||
|
: Xbyak::CodeGenerator(total_code_size, Xbyak::AutoGrow, &s_allocator)
|
||||||
|
#elif defined(DYNARMIC_ENABLE_NO_EXECUTE_SUPPORT)
|
||||||
|
: Xbyak::CodeGenerator(total_code_size, Xbyak::DontSetProtectRWE, &s_allocator)
|
||||||
|
#else
|
||||||
|
: Xbyak::CodeGenerator(total_code_size, nullptr, &s_allocator)
|
||||||
|
#endif
|
||||||
, cb(std::move(cb))
|
, cb(std::move(cb))
|
||||||
, jsi(jsi)
|
, jsi(jsi)
|
||||||
, constant_pool(*this, CONSTANT_POOL_SIZE)
|
, constant_pool(*this, CONSTANT_POOL_SIZE)
|
||||||
|
|
@ -533,8 +546,12 @@ size_t BlockOfCode::GetTotalCodeSize() const {
|
||||||
|
|
||||||
void* BlockOfCode::AllocateFromCodeSpace(size_t alloc_size) {
|
void* BlockOfCode::AllocateFromCodeSpace(size_t alloc_size) {
|
||||||
if (size_ + alloc_size >= maxSize_) {
|
if (size_ + alloc_size >= maxSize_) {
|
||||||
|
#ifndef XBYAK_NO_EXCEPTION
|
||||||
using Xbyak::Error;
|
using Xbyak::Error;
|
||||||
XBYAK_THROW(Xbyak::ERR_CODE_IS_TOO_BIG);
|
XBYAK_THROW(Xbyak::ERR_CODE_IS_TOO_BIG);
|
||||||
|
#else
|
||||||
|
std::abort();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
EnsureMemoryCommitted(alloc_size);
|
EnsureMemoryCommitted(alloc_size);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue