mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-04-10 05:28:56 +02:00
[dynarmic] support -fno-exception compilations to reduce unwind table overheads
Signed-off-by: lizzie <lizzie@eden-emu.dev>
This commit is contained in:
parent
30bc1b455e
commit
1a9afa41b4
7 changed files with 9 additions and 15 deletions
|
|
@ -5,6 +5,7 @@
|
|||
|
||||
#include <bitset>
|
||||
#include <initializer_list>
|
||||
#define XBYAK_NO_EXCEPTION 1
|
||||
#include <xbyak/xbyak.h>
|
||||
#include "common/assert.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <type_traits>
|
||||
#define XBYAK_NO_EXCEPTION 1
|
||||
#include <xbyak/xbyak.h>
|
||||
#include "common/x64/xbyak_abi.h"
|
||||
|
||||
|
|
|
|||
|
|
@ -95,7 +95,7 @@ else()
|
|||
-pedantic
|
||||
-Wno-missing-braces
|
||||
-fno-rtti
|
||||
#-fno-exceptions
|
||||
-fno-exceptions
|
||||
)
|
||||
if (CXX_GCC)
|
||||
# GCC produces bogus -Warray-bounds warnings from xbyak headers for code paths that are not
|
||||
|
|
|
|||
|
|
@ -66,10 +66,7 @@ public:
|
|||
#ifdef _WIN32
|
||||
uint8_t* alloc(size_t size) override {
|
||||
void* p = VirtualAlloc(nullptr, size, MEM_RESERVE, PAGE_READWRITE);
|
||||
if (p == nullptr) {
|
||||
using Xbyak::Error;
|
||||
XBYAK_THROW(Xbyak::ERR_CANT_ALLOC);
|
||||
}
|
||||
ASSERT(p != nullptr);
|
||||
return static_cast<uint8_t*>(p);
|
||||
}
|
||||
|
||||
|
|
@ -105,10 +102,7 @@ public:
|
|||
prot |= PROT_MPROTECT(PROT_READ) | PROT_MPROTECT(PROT_WRITE) | PROT_MPROTECT(PROT_EXEC);
|
||||
#endif
|
||||
void* p = mmap(nullptr, size, prot, mode, -1, 0);
|
||||
if (p == MAP_FAILED) {
|
||||
using Xbyak::Error;
|
||||
XBYAK_THROW(Xbyak::ERR_CANT_ALLOC);
|
||||
}
|
||||
ASSERT(p != MAP_FAILED);
|
||||
std::memcpy(p, &size, sizeof(size_t));
|
||||
return static_cast<uint8_t*>(p) + DYNARMIC_PAGE_SIZE;
|
||||
}
|
||||
|
|
@ -532,13 +526,8 @@ size_t BlockOfCode::GetTotalCodeSize() const {
|
|||
}
|
||||
|
||||
void* BlockOfCode::AllocateFromCodeSpace(size_t alloc_size) {
|
||||
if (size_ + alloc_size >= maxSize_) {
|
||||
using Xbyak::Error;
|
||||
XBYAK_THROW(Xbyak::ERR_CODE_IS_TOO_BIG);
|
||||
}
|
||||
|
||||
ASSERT(!(size_ + alloc_size >= maxSize_));
|
||||
EnsureMemoryCommitted(alloc_size);
|
||||
|
||||
void* ret = getCurr<void*>();
|
||||
size_ += alloc_size;
|
||||
memset(ret, 0, alloc_size);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <bitset>
|
||||
#define XBYAK_NO_EXCEPTION 1
|
||||
#include <xbyak/xbyak.h>
|
||||
|
||||
#include "dynarmic/common/assert.h"
|
||||
|
|
|
|||
|
|
@ -11,5 +11,6 @@
|
|||
// #define XBYAK_STD_UNORDERED_MAP ankerl::unordered_dense::map
|
||||
// #define XBYAK_STD_UNORDERED_MULTIMAP boost::unordered_multimap
|
||||
|
||||
#define XBYAK_NO_EXCEPTION 1
|
||||
#include <xbyak/xbyak.h>
|
||||
#include <xbyak/xbyak_util.h>
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#pragma clang diagnostic ignored "-Wconversion"
|
||||
#pragma clang diagnostic ignored "-Wshadow"
|
||||
#endif
|
||||
#define XBYAK_NO_EXCEPTION 1
|
||||
#include <xbyak/xbyak.h>
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue