summaryrefslogtreecommitdiff
path: root/js/src/wasm/WasmSignalHandlers.cpp
diff options
context:
space:
mode:
authorBrian Smith <brian@dbsoft.org>2022-06-09 22:05:20 -0500
committerBrian Smith <brian@dbsoft.org>2022-06-09 22:05:20 -0500
commita977ba55eb80984b38c8f9a31778c948afa55c20 (patch)
tree9c45e3d721b9b3808c190f225cbd73f0c8f51bb5 /js/src/wasm/WasmSignalHandlers.cpp
parent8199a0d551455314809de775164d592c5a4aad9d (diff)
downloaduxp-a977ba55eb80984b38c8f9a31778c948afa55c20.tar.gz
Issue #1905 - Part 3g - Final set of changes connecting ARM64 support for Mac.
Back out some of the xptcstubs changes that are not viable for our codebase.
Diffstat (limited to 'js/src/wasm/WasmSignalHandlers.cpp')
-rw-r--r--js/src/wasm/WasmSignalHandlers.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/js/src/wasm/WasmSignalHandlers.cpp b/js/src/wasm/WasmSignalHandlers.cpp
index 7699b336cc..36011abe90 100644
--- a/js/src/wasm/WasmSignalHandlers.cpp
+++ b/js/src/wasm/WasmSignalHandlers.cpp
@@ -283,6 +283,12 @@ struct macos_arm_context {
arm_neon_state_t float_;
};
# define EMULATOR_CONTEXT macos_arm_context
+# elif defined(__aarch64__)
+struct macos_aarch64_context {
+ arm_thread_state64_t thread;
+ arm_neon_state64_t float_;
+};
+# define EMULATOR_CONTEXT macos_aarch64_context
# else
# error Unsupported architecture
# endif
@@ -800,7 +806,7 @@ ContextToPC(EMULATOR_CONTEXT* context)
static_assert(sizeof(context->thread.uts.ts32.__eip) == sizeof(void*),
"stored IP should be compile-time pointer-sized");
return reinterpret_cast<uint8_t**>(&context->thread.uts.ts32.__eip);
-# elif defined(JS_CPU_ARM)
+# elif defined(JS_CPU_ARM) || defined(__aarch64__)
static_assert(sizeof(context->thread.__pc) == sizeof(void*),
"stored IP should be compile-time pointer-sized");
return reinterpret_cast<uint8_t**>(&context->thread.__pc);
@@ -861,6 +867,11 @@ HandleMachException(JSRuntime* rt, const ExceptionRequest& request)
unsigned int float_state_count = ARM_NEON_STATE_COUNT;
int thread_state = ARM_THREAD_STATE;
int float_state = ARM_NEON_STATE;
+# elif defined(__aarch64__)
+ unsigned int thread_state_count = ARM_THREAD_STATE64_COUNT;
+ unsigned int float_state_count = ARM_NEON_STATE64_COUNT;
+ int thread_state = ARM_THREAD_STATE64;
+ int float_state = ARM_NEON_STATE64;
# else
# error Unsupported architecture
# endif