Commit 2c28bc9e authored by Eric Holk's avatar Eric Holk Committed by Commit Bot

Make failing to enable WebAssembly trap handler non-fatal

V8's side of this function fails safely, leaving trap handlers disabled and
relying on bounds checks. There's no reason to make this a fatal failure
here. This also lets us remove the special cases around sanitizers, operating
systems, and architectures, because V8 knows what configurations are supported
for trap handlers.

Change-Id: I461af9590f336e912f94e5cf169f50ddd985b839
Reviewed-on: https://chromium-review.googlesource.com/988257Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Eric Holk <eholk@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547534}
parent 4459f6fe
......@@ -154,10 +154,7 @@ RenderProcessImpl::RenderProcessImpl(
"--harmony-array-prototype-values");
SetV8FlagIfNotFeature(features::kArrayPrototypeValues,
"--no-harmony-array-prototype-values");
// Memory sanitizer compiles V8 to generate ARM code and run it in a simulator,
// meaning we cannot support trap handlers there.
#if defined(OS_LINUX) && defined(ARCH_CPU_X86_64) && !defined(OS_ANDROID) && \
!defined(MEMORY_SANITIZER)
#if defined(OS_LINUX) && defined(ARCH_CPU_X86_64) && !defined(OS_ANDROID)
if (base::FeatureList::IsEnabled(features::kWebAssemblyTrapHandler)) {
bool use_v8_signal_handler = false;
base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
......@@ -173,7 +170,8 @@ RenderProcessImpl::RenderProcessImpl(
// (https://crbug.com/798150).
use_v8_signal_handler = true;
}
CHECK(v8::V8::EnableWebAssemblyTrapHandler(use_v8_signal_handler));
// TODO(eholk): report UMA stat for how often this succeeds
v8::V8::EnableWebAssemblyTrapHandler(use_v8_signal_handler);
}
#endif
......
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