force ankerl + fixup for OO with prelude commits

This commit is contained in:
lizzie
2026-01-31 12:34:57 +00:00
parent cbb41001de
commit cb360edd7b
24 changed files with 109 additions and 32 deletions

View 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

View 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

View File

@@ -55,7 +55,10 @@
"hash": "b40dade90fb0e46a2bd52934f7ce461e37be931b571e58cbe2203bc08ed5b54c7ff1a29026c74c7f9805e4e3f6c9636deca528e6b4a8093ce7eae145218599f1",
"git_version": "7.29",
"bundled": true,
"skip_updates": true
"skip_updates": true,
"patches": [
"0001-macro-stl.patch"
]
},
"xbyak": {
"package": "xbyak",
@@ -64,7 +67,10 @@
"hash": "1042090405c426e339506c179d53e91d4d545ce9c9f53d8f797caa092d589f913a9bcb9c8f31c4c60870acb954c556e305fb6732c66bc3c8f1cd924f9172def9",
"git_version": "7.22",
"bundled": true,
"skip_updates": true
"skip_updates": true,
"patches": [
"0001-macro-stl.patch"
]
},
"oaknut": {
"repo": "eden-emulator/oaknut",

View File

@@ -204,7 +204,7 @@ void ArmDynarmic32::MakeJit(Common::PageTable* page_table) {
// Code cache size
#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__)
config.code_cache_size = std::uint32_t(128_MiB);
#else

View File

@@ -255,7 +255,7 @@ void ArmDynarmic64::MakeJit(Common::PageTable* page_table, std::size_t address_s
// Code cache size
#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__)
config.code_cache_size = std::uint32_t(128_MiB);
#else

View File

@@ -14,7 +14,7 @@
#include <fmt/format.h>
#include <fmt/ostream.h>
#include <mcl/type_traits/integer_of_size.hpp>
#include <xbyak/xbyak.h>
#include "dynarmic/backend/x64/xbyak.h"
#include "dynarmic/backend/x64/a32_emit_x64.h"
#include "dynarmic/backend/x64/abi.h"

View File

@@ -14,7 +14,7 @@
#include <fmt/format.h>
#include <fmt/ostream.h>
#include <mcl/type_traits/integer_of_size.hpp>
#include <xbyak/xbyak.h>
#include "dynarmic/backend/x64/xbyak.h"
#include "dynarmic/backend/x64/a64_emit_x64.h"
#include "dynarmic/backend/x64/abi.h"

View File

@@ -11,7 +11,7 @@
#include <algorithm>
#include "dynarmic/common/common_types.h"
#include <xbyak/xbyak.h>
#include "dynarmic/backend/x64/xbyak.h"
#include "dynarmic/backend/x64/block_of_code.h"

View File

@@ -26,7 +26,7 @@
#include "dynarmic/common/assert.h"
#include <mcl/bit/bit_field.hpp>
#include <xbyak/xbyak.h>
#include "dynarmic/backend/x64/xbyak.h"
#include "dynarmic/backend/x64/a32_jitstate.h"
#include "dynarmic/backend/x64/abi.h"
@@ -58,8 +58,13 @@ const std::array<Xbyak::Reg64, ABI_PARAM_COUNT> BlockOfCode::ABI_PARAMS = {Block
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 PRELUDE_COMMIT_SIZE = 16 * 1024 * 1024;
#endif
class CustomXbyakAllocator : public Xbyak::Allocator {
public:
@@ -67,8 +72,12 @@ public:
uint8_t* alloc(size_t size) override {
void* p = VirtualAlloc(nullptr, size, MEM_RESERVE, PAGE_READWRITE);
if (p == nullptr) {
#ifndef XBYAK_NO_EXCEPTION
using Xbyak::Error;
XBYAK_THROW(Xbyak::ERR_CANT_ALLOC);
#else
std::abort();
#endif
}
return static_cast<uint8_t*>(p);
}
@@ -106,8 +115,12 @@ public:
#endif
void* p = mmap(nullptr, size, prot, mode, -1, 0);
if (p == MAP_FAILED) {
#ifndef XBYAK_NO_EXCEPTION
using Xbyak::Error;
XBYAK_THROW(Xbyak::ERR_CANT_ALLOC);
#else
std::abort();
#endif
}
std::memcpy(p, &size, sizeof(size_t));
return static_cast<uint8_t*>(p) + DYNARMIC_PAGE_SIZE;
@@ -233,14 +246,14 @@ bool IsUnderRosetta() {
} // 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
: 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))
, jsi(jsi)
, constant_pool(*this, CONSTANT_POOL_SIZE)
@@ -533,8 +546,12 @@ size_t BlockOfCode::GetTotalCodeSize() const {
void* BlockOfCode::AllocateFromCodeSpace(size_t alloc_size) {
if (size_ + alloc_size >= maxSize_) {
#ifndef XBYAK_NO_EXCEPTION
using Xbyak::Error;
XBYAK_THROW(Xbyak::ERR_CODE_IS_TOO_BIG);
#else
std::abort();
#endif
}
EnsureMemoryCommitted(alloc_size);

View File

@@ -15,9 +15,7 @@
#include <mcl/bit/bit_field.hpp>
#include "dynarmic/common/common_types.h"
#include <xbyak/xbyak.h>
#include <xbyak/xbyak_util.h>
#include "dynarmic/backend/x64/xbyak.h"
#include "dynarmic/backend/x64/abi.h"
#include "dynarmic/backend/x64/callback.h"
#include "dynarmic/backend/x64/constant_pool.h"

View File

@@ -12,7 +12,7 @@
#include <vector>
#include "dynarmic/common/common_types.h"
#include <xbyak/xbyak.h>
#include "dynarmic/backend/x64/xbyak.h"
namespace Dynarmic::Backend::X64 {

View File

@@ -15,7 +15,7 @@
#include "dynarmic/common/common_types.h"
#include <ankerl/unordered_dense.h>
#include <xbyak/xbyak.h>
#include "dynarmic/backend/x64/xbyak.h"
namespace Dynarmic::Backend::X64 {

View File

@@ -18,8 +18,7 @@
#include <mcl/bitsizeof.hpp>
#include <ankerl/unordered_dense.h>
#include <xbyak/xbyak.h>
#include <xbyak/xbyak_util.h>
#include "dynarmic/backend/x64/xbyak.h"
#include <boost/container/small_vector.hpp>
#include "dynarmic/backend/exception_handler.h"

View File

@@ -19,7 +19,7 @@
#include <mcl/mp/typelist/lower_to_tuple.hpp>
#include "dynarmic/common/common_types.h"
#include <mcl/type_traits/integer_of_size.hpp>
#include <xbyak/xbyak.h>
#include "dynarmic/backend/x64/xbyak.h"
#include "dynarmic/backend/x64/abi.h"
#include "dynarmic/backend/x64/block_of_code.h"

View File

@@ -7,7 +7,7 @@
*/
#include <bit>
#include <xbyak/xbyak.h>
#include "dynarmic/backend/x64/xbyak.h"
#include "dynarmic/backend/x64/a32_emit_x64.h"
#include "dynarmic/backend/x64/a64_emit_x64.h"

View File

@@ -18,7 +18,7 @@
#include <mcl/bitsizeof.hpp>
#include "dynarmic/common/common_types.h"
#include <mcl/type_traits/function_info.hpp>
#include <xbyak/xbyak.h>
#include "dynarmic/backend/x64/xbyak.h"
#include "dynarmic/backend/x64/abi.h"
#include "dynarmic/backend/x64/block_of_code.h"

View File

@@ -21,7 +21,7 @@
#include <mcl/mp/typelist/lower_to_tuple.hpp>
#include <mcl/type_traits/function_info.hpp>
#include <mcl/type_traits/integer_of_size.hpp>
#include <xbyak/xbyak.h>
#include "dynarmic/backend/x64/xbyak.h"
#include "dynarmic/backend/x64/abi.h"
#include "dynarmic/backend/x64/block_of_code.h"

View File

@@ -9,7 +9,7 @@
#include "dynarmic/common/assert.h"
#include "dynarmic/common/common_types.h"
#include <xbyak/xbyak.h>
#include "dynarmic/backend/x64/xbyak.h"
namespace Dynarmic::Backend::X64 {

View File

@@ -9,7 +9,7 @@
#pragma once
#include "dynarmic/common/assert.h"
#include <xbyak/xbyak.h>
#include "dynarmic/backend/x64/xbyak.h"
namespace Dynarmic::Backend::X64 {

View File

@@ -16,7 +16,7 @@
#include <fmt/ostream.h>
#include "dynarmic/common/assert.h"
#include <bit>
#include <xbyak/xbyak.h>
#include "dynarmic/backend/x64/xbyak.h"
#include "dynarmic/backend/x64/abi.h"
#include "dynarmic/backend/x64/stack_layout.h"

View File

@@ -14,7 +14,7 @@
#include "boost/container/small_vector.hpp"
#include "dynarmic/common/common_types.h"
#include <xbyak/xbyak.h>
#include "dynarmic/backend/x64/xbyak.h"
#include <boost/container/static_vector.hpp>
#include <boost/container/flat_set.hpp>
#include <boost/pool/pool_alloc.hpp>

View File

@@ -0,0 +1,15 @@
#pragma once
#ifdef __OPENORBIS__
#define XBYAK_NO_EXCEPTION 1
#endif
#define XBYAK_STD_UNORDERED_SET ankerl::unordered_dense::set
#define XBYAK_STD_UNORDERED_MAP ankerl::unordered_dense::map
#define XBYAK_STD_UNORDERED_MULTIMAP std::unordered_multimap
#include <ankerl/unordered_dense.h>
#include <unordered_map>
#include <xbyak/xbyak.h>
#include <xbyak/xbyak_util.h>

View File

@@ -8,7 +8,7 @@
#include <mutex>
#include <optional>
#include <xbyak/xbyak.h>
#include "dynarmic/backend/x64/xbyak.h"
#include "dynarmic/backend/x64/abi.h"
#include "dynarmic/backend/x64/hostloc.h"

View File

@@ -8,7 +8,7 @@
#pragma once
#include <xbyak/xbyak.h>
#include "dynarmic/backend/x64/xbyak.h"
namespace Dynarmic {