From 2c9dcfa2dbea1b78d9b2f31014cc31dbf03e106e Mon Sep 17 00:00:00 2001 From: MerryMage Date: Thu, 20 Apr 2017 14:08:56 +0100 Subject: [PATCH] backend_x64: Rename UnwindHandler to ExceptionHandler --- src/CMakeLists.txt | 4 ++-- src/backend_x64/block_of_code.cpp | 2 +- src/backend_x64/block_of_code.h | 8 ++++---- .../{unwind_generic.cpp => exception_handler_generic.cpp} | 8 ++++---- .../{unwind_windows.cpp => exception_handler_windows.cpp} | 8 ++++---- 5 files changed, 15 insertions(+), 15 deletions(-) rename src/backend_x64/{unwind_generic.cpp => exception_handler_generic.cpp} (61%) rename src/backend_x64/{unwind_windows.cpp => exception_handler_windows.cpp} (96%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 1e90fae3..4b2affab 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -96,9 +96,9 @@ if (ARCHITECTURE_x86_64) ) if (WIN32) - list(APPEND SRCS backend_x64/unwind_windows.cpp) + list(APPEND SRCS backend_x64/exception_handler_windows.cpp) else() - list(APPEND SRCS backend_x64/unwind_generic.cpp) + list(APPEND SRCS backend_x64/exception_handler_generic.cpp) endif() else() message(FATAL_ERROR "Unsupported architecture") diff --git a/src/backend_x64/block_of_code.cpp b/src/backend_x64/block_of_code.cpp index 29791982..333bc3dc 100644 --- a/src/backend_x64/block_of_code.cpp +++ b/src/backend_x64/block_of_code.cpp @@ -30,7 +30,7 @@ BlockOfCode::BlockOfCode(UserCallbacks cb, LookupBlockCallback lookup_block, voi { GenRunCode(); GenMemoryAccessors(); - unwind_handler.Register(this); + exception_handler.Register(this); near_code_begin = getCurr(); far_code_begin = getCurr() + FAR_CODE_OFFSET; ClearCache(); diff --git a/src/backend_x64/block_of_code.h b/src/backend_x64/block_of_code.h index 4a9a1cbb..e802b56c 100644 --- a/src/backend_x64/block_of_code.h +++ b/src/backend_x64/block_of_code.h @@ -158,17 +158,17 @@ private: const void* write_memory_64 = nullptr; void GenMemoryAccessors(); - class UnwindHandler final { + class ExceptionHandler final { public: - UnwindHandler(); - ~UnwindHandler(); + ExceptionHandler(); + ~ExceptionHandler(); void Register(BlockOfCode* code); private: struct Impl; std::unique_ptr impl; }; - UnwindHandler unwind_handler; + ExceptionHandler exception_handler; }; } // namespace BackendX64 diff --git a/src/backend_x64/unwind_generic.cpp b/src/backend_x64/exception_handler_generic.cpp similarity index 61% rename from src/backend_x64/unwind_generic.cpp rename to src/backend_x64/exception_handler_generic.cpp index e01e8118..cd34da97 100644 --- a/src/backend_x64/unwind_generic.cpp +++ b/src/backend_x64/exception_handler_generic.cpp @@ -9,13 +9,13 @@ namespace Dynarmic { namespace BackendX64 { -struct BlockOfCode::UnwindHandler::Impl final { +struct BlockOfCode::ExceptionHandler::Impl final { }; -BlockOfCode::UnwindHandler::UnwindHandler() = default; -BlockOfCode::UnwindHandler::~UnwindHandler() = default; +BlockOfCode::ExceptionHandler::ExceptionHandler() = default; +BlockOfCode::ExceptionHandler::~ExceptionHandler() = default; -void BlockOfCode::UnwindHandler::Register(BlockOfCode*) { +void BlockOfCode::ExceptionHandler::Register(BlockOfCode*) { // Do nothing } diff --git a/src/backend_x64/unwind_windows.cpp b/src/backend_x64/exception_handler_windows.cpp similarity index 96% rename from src/backend_x64/unwind_windows.cpp rename to src/backend_x64/exception_handler_windows.cpp index 58e47893..1511f186 100644 --- a/src/backend_x64/unwind_windows.cpp +++ b/src/backend_x64/exception_handler_windows.cpp @@ -157,7 +157,7 @@ static PrologueInformation GetPrologueInformation() { return ret; } -struct BlockOfCode::UnwindHandler::Impl final { +struct BlockOfCode::ExceptionHandler::Impl final { Impl(RUNTIME_FUNCTION* rfuncs_, const u8* base_ptr) : rfuncs(rfuncs_) { RtlAddFunctionTable(rfuncs, 1, reinterpret_cast(base_ptr)); } @@ -170,10 +170,10 @@ private: RUNTIME_FUNCTION* rfuncs = nullptr; }; -BlockOfCode::UnwindHandler::UnwindHandler() = default; -BlockOfCode::UnwindHandler::~UnwindHandler() = default; +BlockOfCode::ExceptionHandler::ExceptionHandler() = default; +BlockOfCode::ExceptionHandler::~ExceptionHandler() = default; -void BlockOfCode::UnwindHandler::Register(BlockOfCode* code) { +void BlockOfCode::ExceptionHandler::Register(BlockOfCode* code) { const auto prolog_info = GetPrologueInformation(); code->align(16);