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/508838
Reviewed-by: Jochen Eisinger <jochen@chromium.org>
Commit-Queue: Eric Holk <eholk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#45468}
This commit is contained in:
Eric Holk 2017-05-19 13:14:49 -07:00 committed by Commit Bot
parent 9b1d22fc2c
commit 381d7b1c74
2 changed files with 8 additions and 4 deletions

View File

@ -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

View File

@ -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();