Commit 381d7b1c authored by Eric Holk's avatar Eric Holk Committed by Commit Bot

Make TryHandleSignal available on all POSIX platforms

TryHandleSignal was originally limited by conditional compilation to only
platforms where the WebAssembly trap handler is supported. This caused build
problems, because not all the macros we needed were defined everywhere.

Instead, we make TryHandleSignal available on all POSIX platforms, but it
unconditionally returns false if the trap handler is not supported.

Bug: 
Change-Id: Iab4baf39b1708989edecc4ecfb51b926d8f7fe8d
Reviewed-on: https://chromium-review.googlesource.com/508838Reviewed-by: 's avatarJochen Eisinger <jochen@chromium.org>
Commit-Queue: Eric Holk <eholk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45468}
parent 9b1d22fc
......@@ -7913,7 +7913,7 @@ class V8_EXPORT V8 {
*/
static void ShutdownPlatform();
#if V8_OS_LINUX && V8_TARGET_ARCH_X64 && !V8_OS_ANDROID
#if V8_OS_POSIX
/**
* Give the V8 signal handler a chance to handle a fault.
*
......@@ -7934,7 +7934,7 @@ class V8_EXPORT V8 {
* points to a ucontext_t structure.
*/
static bool TryHandleSignal(int signal_number, void* info, void* context);
#endif // V8_OS_LINUX
#endif // V8_OS_POSIX
/**
* Enable the default signal handler rather than using one provided by the
......
......@@ -6276,12 +6276,16 @@ bool v8::V8::Initialize() {
return true;
}
#if V8_OS_LINUX && V8_TARGET_ARCH_X64 && !V8_OS_ANDROID
#if V8_OS_POSIX
bool V8::TryHandleSignal(int signum, void* info, void* context) {
#if V8_OS_LINUX && V8_TARGET_ARCH_X64 && !V8_OS_ANDROID
return v8::internal::trap_handler::TryHandleSignal(
signum, static_cast<siginfo_t*>(info), static_cast<ucontext_t*>(context));
#else // V8_OS_LINUX && V8_TARGET_ARCH_X64 && !V8_OS_ANDROID
return false;
#endif
}
#endif // V8_OS_LINUX
#endif
bool V8::RegisterDefaultSignalHandler() {
return v8::internal::trap_handler::RegisterDefaultSignalHandler();
......
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