Commit 3bd45329 authored by Andreas Haas's avatar Andreas Haas Committed by Commit Bot

[v8][macosx] Use V8's default wasm trap handler on MacOS

This CL enables WebAssembly trap handlers on MacOS. In this CL we use
the default trap handler provided by V8.

Bug: chromium:906565

Change-Id: I2d007da1a86ca05010a0a7bf830586767f19a24d
Reviewed-on: https://chromium-review.googlesource.com/c/1290955
Commit-Queue: Andreas Haas <ahaas@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Reviewed-by: default avatarMark Mentovai <mark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#609942}
parent 51a201b0
...@@ -25,6 +25,8 @@ namespace { ...@@ -25,6 +25,8 @@ namespace {
constexpr bool kIsTrapHandlerSupported = true; constexpr bool kIsTrapHandlerSupported = true;
#elif defined(OS_WIN) && defined(ARCH_CPU_X86_64) #elif defined(OS_WIN) && defined(ARCH_CPU_X86_64)
constexpr bool kIsTrapHandlerSupported = true; constexpr bool kIsTrapHandlerSupported = true;
#elif defined(OS_MACOSX) && defined(ARCH_CPU_X86_64)
constexpr bool kIsTrapHandlerSupported = true;
#else #else
constexpr bool kIsTrapHandlerSupported = false; constexpr bool kIsTrapHandlerSupported = false;
#endif #endif
......
...@@ -197,6 +197,15 @@ RenderProcessImpl::RenderProcessImpl( ...@@ -197,6 +197,15 @@ RenderProcessImpl::RenderProcessImpl(
v8::V8::EnableWebAssemblyTrapHandler(use_v8_trap_handler); v8::V8::EnableWebAssemblyTrapHandler(use_v8_trap_handler);
} }
#endif #endif
#if defined(OS_MACOSX) && defined(ARCH_CPU_X86_64)
if (base::FeatureList::IsEnabled(features::kWebAssemblyTrapHandler)) {
// On macOS, Crashpad uses exception ports to handle signals in a different
// process. As we cannot just pass a callback to this other process, we ask
// V8 to install its own signal handler to deal with WebAssembly traps.
bool use_v8_signal_handler = true;
v8::V8::EnableWebAssemblyTrapHandler(use_v8_signal_handler);
}
#endif // defined(OS_MACOSX) && defined(ARCH_CPU_X86_64)
const base::CommandLine& command_line = const base::CommandLine& command_line =
*base::CommandLine::ForCurrentProcess(); *base::CommandLine::ForCurrentProcess();
......
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