[wasm] Remove --wasm-shared-engine runtime flag.

With the recent removal of the --wasm-shared-code flag, it became
effectively impossible to turn off this flag. Hence its functionality
became mandatory and the ability to turn off sharing of {WasmEngine}
process-wide has to be removed as well.

R=clemensb@chromium.org

Change-Id: I7c25e909e49134a226d6a9fe9c42f0ecd9d02a69
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1864935
Commit-Queue: Michael Starzinger <mstarzinger@chromium.org>
Reviewed-by: Clemens Backes <clemensb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64322}
This commit is contained in:
Michael Starzinger 2019-10-16 15:28:32 +02:00 committed by Commit Bot
parent 7d09b270d8
commit c2e95a362a
7 changed files with 7 additions and 13 deletions

View File

@ -730,9 +730,6 @@ DEFINE_BOOL(wasm_no_stack_checks, false,
DEFINE_BOOL(wasm_math_intrinsics, true,
"intrinsify some Math imports into wasm")
DEFINE_BOOL(wasm_shared_engine, true,
"shares one wasm engine between all isolates within a process")
DEFINE_IMPLICATION(future, wasm_shared_engine)
DEFINE_BOOL(wasm_trap_handler, true,
"use signal handlers to catch out of bounds memory access in wasm"
" (currently Linux x86_64 only)")

View File

@ -1231,7 +1231,7 @@ RUNTIME_FUNCTION(Runtime_CloneWasmModule) {
CONVERT_ARG_HANDLE_CHECKED(WasmModuleObject, module_object, 0);
Handle<WasmModuleObject> new_module_object =
wasm::WasmEngine::GetWasmEngine()->ImportNativeModule(
isolate->wasm_engine()->ImportNativeModule(
isolate, module_object->shared_native_module());
return *new_module_object;

View File

@ -959,20 +959,17 @@ DEFINE_LAZY_LEAKY_OBJECT_GETTER(std::shared_ptr<WasmEngine>,
// static
void WasmEngine::InitializeOncePerProcess() {
if (!FLAG_wasm_shared_engine) return;
*GetSharedWasmEngine() = std::make_shared<WasmEngine>();
}
// static
void WasmEngine::GlobalTearDown() {
if (!FLAG_wasm_shared_engine) return;
GetSharedWasmEngine()->reset();
}
// static
std::shared_ptr<WasmEngine> WasmEngine::GetWasmEngine() {
if (FLAG_wasm_shared_engine) return *GetSharedWasmEngine();
return std::make_shared<WasmEngine>();
return *GetSharedWasmEngine();
}
// {max_mem_pages} is declared in wasm-limits.h.

View File

@ -215,8 +215,9 @@ class V8_EXPORT_PRIVATE WasmEngine {
static void InitializeOncePerProcess();
static void GlobalTearDown();
// Constructs a WasmEngine instance. Depending on whether we are sharing
// engines this might be a pointer to a new instance or to a shared one.
// Returns a reference to the WasmEngine shared by the entire process. Try to
// use {Isolate::wasm_engine} instead if it is available, which encapsulates
// engine lifetime decisions during Isolate bootstrapping.
static std::shared_ptr<WasmEngine> GetWasmEngine();
private:

View File

@ -272,7 +272,6 @@ TEST(BlockWasmCodeGenAtDeserialization) {
}
UNINITIALIZED_TEST(CompiledWasmModulesTransfer) {
FlagScope<bool> flag_scope_engine(&FLAG_wasm_shared_engine, true);
i::wasm::WasmEngine::InitializeOncePerProcess();
v8::internal::AccountingAllocator allocator;
Zone zone(&allocator, ZONE_NAME);

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --wasm-shared-engine --no-wasm-disable-structured-cloning --allow-natives-syntax --experimental-wasm-threads
// Flags: --no-wasm-disable-structured-cloning --allow-natives-syntax --experimental-wasm-threads
load('test/mjsunit/wasm/wasm-module-builder.js');

View File

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --wasm-shared-engine --no-wasm-disable-structured-cloning
// Flags: --no-wasm-disable-structured-cloning
load("test/mjsunit/wasm/wasm-module-builder.js");