Browse Source

fx

lizzie/noexcept-dynarmic
lizzie 4 months ago
parent
commit
38bdbf4c4f
  1. 3
      src/common/x64/xbyak.h
  2. 4
      src/dynarmic/CMakeLists.txt
  3. 7
      src/dynarmic/src/dynarmic/backend/x64/block_of_code.cpp
  4. 1
      src/dynarmic/src/dynarmic/backend/x64/xbyak.h

3
src/common/x64/xbyak.h

@ -25,14 +25,13 @@
#include "common/container/unordered_map.h" #include "common/container/unordered_map.h"
#include "common/container/unordered_set.h" #include "common/container/unordered_set.h"
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
#define XBYAK_NO_EXCEPTION 1
#define XBYAK_STD_UNORDERED_SET ::Common::unordered_set #define XBYAK_STD_UNORDERED_SET ::Common::unordered_set
#define XBYAK_STD_UNORDERED_MAP ::Common::unordered_map #define XBYAK_STD_UNORDERED_MAP ::Common::unordered_map
#define XBYAK_STD_UNORDERED_MULTIMAP boost::unordered_multimap #define XBYAK_STD_UNORDERED_MULTIMAP boost::unordered_multimap
#include <xbyak/xbyak.h> #include <xbyak/xbyak.h>
#include <xbyak/xbyak_util.h> #include <xbyak/xbyak_util.h>
#include <xbyak/xbyak.h>
namespace Common::X64 { namespace Common::X64 {
constexpr size_t RegToIndex(const Xbyak::Reg& reg) { constexpr size_t RegToIndex(const Xbyak::Reg& reg) {

4
src/dynarmic/CMakeLists.txt

@ -113,6 +113,10 @@ else()
# Clang mistakenly blames CMake for using unused arguments during compilation # Clang mistakenly blames CMake for using unused arguments during compilation
list(APPEND DYNARMIC_CXX_FLAGS -Wno-unused-command-line-argument) list(APPEND DYNARMIC_CXX_FLAGS -Wno-unused-command-line-argument)
endif() endif()
# TODO: oaknut exceptions
if ("x86_64" IN_LIST ARCHITECTURE)
list(APPEND DYNARMIC_CXX_FLAGS -fno-exceptions)
endif()
endif() endif()
if (NOT Boost_FOUND) if (NOT Boost_FOUND)

7
src/dynarmic/src/dynarmic/backend/x64/block_of_code.cpp

@ -465,13 +465,8 @@ size_t BlockOfCode::GetTotalCodeSize() const {
} }
void* BlockOfCode::AllocateFromCodeSpace(size_t alloc_size) { 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); EnsureMemoryCommitted(alloc_size);
void* ret = getCurr<void*>(); void* ret = getCurr<void*>();
size_ += alloc_size; size_ += alloc_size;
memset(ret, 0, alloc_size); memset(ret, 0, alloc_size);

1
src/dynarmic/src/dynarmic/backend/x64/xbyak.h

@ -7,6 +7,7 @@
#include "common/container/unordered_map.h" #include "common/container/unordered_map.h"
#include "common/container/unordered_set.h" #include "common/container/unordered_set.h"
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
#define XBYAK_NO_EXCEPTION 1
#define XBYAK_STD_UNORDERED_SET ::Common::unordered_set #define XBYAK_STD_UNORDERED_SET ::Common::unordered_set
#define XBYAK_STD_UNORDERED_MAP ::Common::unordered_map #define XBYAK_STD_UNORDERED_MAP ::Common::unordered_map
#define XBYAK_STD_UNORDERED_MULTIMAP boost::unordered_multimap #define XBYAK_STD_UNORDERED_MULTIMAP boost::unordered_multimap

Loading…
Cancel
Save