Commit 5a6953fe authored by Jakob Gruber's avatar Jakob Gruber Committed by Commit Bot

[libsampler] Add iOS support in libsampler

This adds support for iOS builds in libsampler. Both iOS simulator
builds (target architecture x64) and iOS device builds (arm64) are
supported.

Note that this is mostly untested since we neither have iOS bots nor
an iOS test runner. This CL was thus only tested by compiling V8 for
both iOS simulator & device targets.

Bug: v8:9140
Change-Id: Ib618bf793771f4be84d1979a968d2b3ef9f6ff86
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1569436Reviewed-by: 's avatarPeter Marshall <petermarshall@chromium.org>
Commit-Queue: Jakob Gruber <jgruber@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60898}
parent 5de852c9
......@@ -434,6 +434,22 @@ void SignalHandler::FillRegisterState(void* context, RegisterState* state) {
state->sp = reinterpret_cast<void*>(ucontext->uc_mcontext.gregs[15]);
state->fp = reinterpret_cast<void*>(ucontext->uc_mcontext.gregs[11]);
#endif // V8_HOST_ARCH_*
#elif V8_OS_IOS
#if V8_TARGET_ARCH_ARM64
// Building for the iOS device.
state->pc = reinterpret_cast<void*>(mcontext->__ss.__pc);
state->sp = reinterpret_cast<void*>(mcontext->__ss.__sp);
state->fp = reinterpret_cast<void*>(mcontext->__ss.__fp);
#elif V8_TARGET_ARCH_X64
// Building for the iOS simulator.
state->pc = reinterpret_cast<void*>(mcontext->__ss.__rip);
state->sp = reinterpret_cast<void*>(mcontext->__ss.__rsp);
state->fp = reinterpret_cast<void*>(mcontext->__ss.__rbp);
#else
#error Unexpected iOS target architecture.
#endif // V8_TARGET_ARCH_ARM64
#elif V8_OS_MACOSX
#if V8_HOST_ARCH_X64
state->pc = reinterpret_cast<void*>(mcontext->__ss.__rip);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment