From 866e3244daf6e8cccd633a7c158b5f006cae40f5 Mon Sep 17 00:00:00 2001 From: BoHong Li Date: Sat, 3 Apr 2021 04:57:11 +0800 Subject: [PATCH] deps: V8: cherry-pick cf71540c684c MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: mac/arm64: Port SignalHandler::FillRegisterState(). Bug: chromium:1098899 Change-Id: I3ff79c00063f7da36b141a3a7b0d2daa71c9801a Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2270705 Commit-Queue: Peter Marshall Reviewed-by: Peter Marshall Auto-Submit: Nico Weber Cr-Commit-Position: refs/heads/master@{#68568} Refs: https://github.com/v8/v8/commit/cf71540c684c54d0d8e1a5aad13f7c4a8d9a3c12 PR-URL: https://github.com/nodejs/node/pull/38051 Refs: https://github.com/nodejs/node/pull/35415 Fixes: https://github.com/nodejs/node/issues/38005 Reviewed-By: Michaƫl Zasso Reviewed-By: Evan Lucas --- common.gypi | 2 +- deps/v8/src/libsampler/sampler.cc | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common.gypi b/common.gypi index 6d358895761ef3..0235880edf83bb 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.26', + 'v8_embedder_string': '-node.27', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/libsampler/sampler.cc b/deps/v8/src/libsampler/sampler.cc index e2091ceb32af87..0443657d1e7e92 100644 --- a/deps/v8/src/libsampler/sampler.cc +++ b/deps/v8/src/libsampler/sampler.cc @@ -468,7 +468,14 @@ void SignalHandler::FillRegisterState(void* context, RegisterState* state) { state->pc = reinterpret_cast(mcontext->__ss.__eip); state->sp = reinterpret_cast(mcontext->__ss.__esp); state->fp = reinterpret_cast(mcontext->__ss.__ebp); -#endif // V8_HOST_ARCH_IA32 +#elif V8_HOST_ARCH_ARM64 + state->pc = + reinterpret_cast(arm_thread_state64_get_pc(mcontext->__ss)); + state->sp = + reinterpret_cast(arm_thread_state64_get_sp(mcontext->__ss)); + state->fp = + reinterpret_cast(arm_thread_state64_get_fp(mcontext->__ss)); +#endif // V8_HOST_ARCH_* #elif V8_OS_FREEBSD #if V8_HOST_ARCH_IA32 state->pc = reinterpret_cast(mcontext.mc_eip);