Commit 251d741f authored by Clemens Backes's avatar Clemens Backes Committed by V8 LUCI CQ

[api] Enable trap handling on all supported configurations

This is a follow-up to https://crrev.com/c/3015557. Even though we
enabled trap handling and use it in wasm code, the embedder callback
still refused to handle the signal.
This CL removed an obsolete comment and simplifies the preprocessor
condition to just check for the V8_TRAP_HANDLER_SUPPORTED variable
instead of repeating the supported platforms.

R=ahaas@chromium.org

Bug: v8:11955, chromium:1231858
Change-Id: I417c790fdb755cba182578e7aa1ce4327f4c05ef
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3045352Reviewed-by: 's avatarAndreas Haas <ahaas@chromium.org>
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#75860}
parent 6bd44dfe
......@@ -5859,14 +5859,7 @@ bool v8::V8::Initialize(const int build_config) {
#if V8_OS_LINUX || V8_OS_MACOSX
bool TryHandleWebAssemblyTrapPosix(int sig_code, siginfo_t* info,
void* context) {
// When the target code runs on the V8 arm simulator, the trap handler does
// not behave as expected: the instruction pointer points inside the simulator
// code rather than the wasm code, so the trap handler cannot find the landing
// pad and lets the process crash. Therefore, only enable trap handlers if
// the host and target arch are the same.
#if V8_ENABLE_WEBASSEMBLY && \
((V8_TARGET_ARCH_X64 && !V8_OS_ANDROID) || \
(V8_HOST_ARCH_ARM64 && V8_TARGET_ARCH_ARM64 && V8_OS_MACOSX))
#if V8_ENABLE_WEBASSEMBLY && V8_TRAP_HANDLER_SUPPORTED
return i::trap_handler::TryHandleSignal(sig_code, info, context);
#else
return false;
......@@ -5881,7 +5874,7 @@ bool V8::TryHandleSignal(int signum, void* info, void* context) {
#if V8_OS_WIN
bool TryHandleWebAssemblyTrapWindows(EXCEPTION_POINTERS* exception) {
#if V8_ENABLE_WEBASSEMBLY && V8_TARGET_ARCH_X64
#if V8_ENABLE_WEBASSEMBLY && V8_TRAP_HANDLER_SUPPORTED
return i::trap_handler::TryHandleWasmTrap(exception);
#else
return false;
......
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