[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:
parent
7d09b270d8
commit
c2e95a362a
@ -730,9 +730,6 @@ DEFINE_BOOL(wasm_no_stack_checks, false,
|
|||||||
DEFINE_BOOL(wasm_math_intrinsics, true,
|
DEFINE_BOOL(wasm_math_intrinsics, true,
|
||||||
"intrinsify some Math imports into wasm")
|
"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,
|
DEFINE_BOOL(wasm_trap_handler, true,
|
||||||
"use signal handlers to catch out of bounds memory access in wasm"
|
"use signal handlers to catch out of bounds memory access in wasm"
|
||||||
" (currently Linux x86_64 only)")
|
" (currently Linux x86_64 only)")
|
||||||
|
@ -1231,7 +1231,7 @@ RUNTIME_FUNCTION(Runtime_CloneWasmModule) {
|
|||||||
CONVERT_ARG_HANDLE_CHECKED(WasmModuleObject, module_object, 0);
|
CONVERT_ARG_HANDLE_CHECKED(WasmModuleObject, module_object, 0);
|
||||||
|
|
||||||
Handle<WasmModuleObject> new_module_object =
|
Handle<WasmModuleObject> new_module_object =
|
||||||
wasm::WasmEngine::GetWasmEngine()->ImportNativeModule(
|
isolate->wasm_engine()->ImportNativeModule(
|
||||||
isolate, module_object->shared_native_module());
|
isolate, module_object->shared_native_module());
|
||||||
|
|
||||||
return *new_module_object;
|
return *new_module_object;
|
||||||
|
@ -959,20 +959,17 @@ DEFINE_LAZY_LEAKY_OBJECT_GETTER(std::shared_ptr<WasmEngine>,
|
|||||||
|
|
||||||
// static
|
// static
|
||||||
void WasmEngine::InitializeOncePerProcess() {
|
void WasmEngine::InitializeOncePerProcess() {
|
||||||
if (!FLAG_wasm_shared_engine) return;
|
|
||||||
*GetSharedWasmEngine() = std::make_shared<WasmEngine>();
|
*GetSharedWasmEngine() = std::make_shared<WasmEngine>();
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void WasmEngine::GlobalTearDown() {
|
void WasmEngine::GlobalTearDown() {
|
||||||
if (!FLAG_wasm_shared_engine) return;
|
|
||||||
GetSharedWasmEngine()->reset();
|
GetSharedWasmEngine()->reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
std::shared_ptr<WasmEngine> WasmEngine::GetWasmEngine() {
|
std::shared_ptr<WasmEngine> WasmEngine::GetWasmEngine() {
|
||||||
if (FLAG_wasm_shared_engine) return *GetSharedWasmEngine();
|
return *GetSharedWasmEngine();
|
||||||
return std::make_shared<WasmEngine>();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// {max_mem_pages} is declared in wasm-limits.h.
|
// {max_mem_pages} is declared in wasm-limits.h.
|
||||||
|
@ -215,8 +215,9 @@ class V8_EXPORT_PRIVATE WasmEngine {
|
|||||||
static void InitializeOncePerProcess();
|
static void InitializeOncePerProcess();
|
||||||
static void GlobalTearDown();
|
static void GlobalTearDown();
|
||||||
|
|
||||||
// Constructs a WasmEngine instance. Depending on whether we are sharing
|
// Returns a reference to the WasmEngine shared by the entire process. Try to
|
||||||
// engines this might be a pointer to a new instance or to a shared one.
|
// use {Isolate::wasm_engine} instead if it is available, which encapsulates
|
||||||
|
// engine lifetime decisions during Isolate bootstrapping.
|
||||||
static std::shared_ptr<WasmEngine> GetWasmEngine();
|
static std::shared_ptr<WasmEngine> GetWasmEngine();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -272,7 +272,6 @@ TEST(BlockWasmCodeGenAtDeserialization) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
UNINITIALIZED_TEST(CompiledWasmModulesTransfer) {
|
UNINITIALIZED_TEST(CompiledWasmModulesTransfer) {
|
||||||
FlagScope<bool> flag_scope_engine(&FLAG_wasm_shared_engine, true);
|
|
||||||
i::wasm::WasmEngine::InitializeOncePerProcess();
|
i::wasm::WasmEngine::InitializeOncePerProcess();
|
||||||
v8::internal::AccountingAllocator allocator;
|
v8::internal::AccountingAllocator allocator;
|
||||||
Zone zone(&allocator, ZONE_NAME);
|
Zone zone(&allocator, ZONE_NAME);
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// 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');
|
load('test/mjsunit/wasm/wasm-module-builder.js');
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
// Use of this source code is governed by a BSD-style license that can be
|
// Use of this source code is governed by a BSD-style license that can be
|
||||||
// found in the LICENSE file.
|
// 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");
|
load("test/mjsunit/wasm/wasm-module-builder.js");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user