diff options
Diffstat (limited to 'deps/v8/test/cctest/wasm/test-wasm-serialization.cc')
-rw-r--r-- | deps/v8/test/cctest/wasm/test-wasm-serialization.cc | 30 |
1 files changed, 7 insertions, 23 deletions
diff --git a/deps/v8/test/cctest/wasm/test-wasm-serialization.cc b/deps/v8/test/cctest/wasm/test-wasm-serialization.cc index 1ff2a899ad..c6486650ef 100644 --- a/deps/v8/test/cctest/wasm/test-wasm-serialization.cc +++ b/deps/v8/test/cctest/wasm/test-wasm-serialization.cc @@ -11,7 +11,6 @@ #include "src/utils/version.h" #include "src/wasm/module-decoder.h" #include "src/wasm/wasm-engine.h" -#include "src/wasm/wasm-memory.h" #include "src/wasm/wasm-module-builder.h" #include "src/wasm/wasm-module.h" #include "src/wasm/wasm-objects-inl.h" @@ -272,9 +271,8 @@ TEST(BlockWasmCodeGenAtDeserialization) { Cleanup(); } -namespace { - -void TestTransferrableWasmModules(bool should_share) { +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); @@ -285,7 +283,7 @@ void TestTransferrableWasmModules(bool should_share) { v8::Isolate::CreateParams create_params; create_params.array_buffer_allocator = CcTest::array_buffer_allocator(); v8::Isolate* from_isolate = v8::Isolate::New(create_params); - std::vector<v8::WasmModuleObject::TransferrableModule> store; + std::vector<v8::CompiledWasmModule> store; std::shared_ptr<NativeModule> original_native_module; { v8::HandleScope scope(from_isolate); @@ -293,7 +291,7 @@ void TestTransferrableWasmModules(bool should_share) { Isolate* from_i_isolate = reinterpret_cast<Isolate*>(from_isolate); testing::SetupIsolateForWasmModule(from_i_isolate); - ErrorThrower thrower(from_i_isolate, "TestTransferrableWasmModules"); + ErrorThrower thrower(from_i_isolate, "TestCompiledWasmModulesTransfer"); auto enabled_features = WasmFeaturesFromIsolate(from_i_isolate); MaybeHandle<WasmModuleObject> maybe_module_object = from_i_isolate->wasm_engine()->SyncCompile( @@ -304,7 +302,7 @@ void TestTransferrableWasmModules(bool should_share) { v8::Local<v8::WasmModuleObject> v8_module = v8::Local<v8::WasmModuleObject>::Cast( v8::Utils::ToLocal(Handle<JSObject>::cast(module_object))); - store.push_back(v8_module->GetTransferrableModule()); + store.push_back(v8_module->GetCompiledModule()); original_native_module = module_object->shared_native_module(); } @@ -315,14 +313,13 @@ void TestTransferrableWasmModules(bool should_share) { LocalContext env(to_isolate); v8::MaybeLocal<v8::WasmModuleObject> transferred_module = - v8::WasmModuleObject::FromTransferrableModule(to_isolate, store[0]); + v8::WasmModuleObject::FromCompiledModule(to_isolate, store[0]); CHECK(!transferred_module.IsEmpty()); Handle<WasmModuleObject> module_object = Handle<WasmModuleObject>::cast( v8::Utils::OpenHandle(*transferred_module.ToLocalChecked())); std::shared_ptr<NativeModule> transferred_native_module = module_object->shared_native_module(); - bool is_sharing = (original_native_module == transferred_native_module); - CHECK_EQ(should_share, is_sharing); + CHECK_EQ(original_native_module, transferred_native_module); } to_isolate->Dispose(); } @@ -330,19 +327,6 @@ void TestTransferrableWasmModules(bool should_share) { from_isolate->Dispose(); } -} // namespace - -UNINITIALIZED_TEST(TransferrableWasmModulesCloned) { - FlagScope<bool> flag_scope_code(&FLAG_wasm_shared_code, false); - TestTransferrableWasmModules(false); -} - -UNINITIALIZED_TEST(TransferrableWasmModulesShared) { - FlagScope<bool> flag_scope_engine(&FLAG_wasm_shared_engine, true); - FlagScope<bool> flag_scope_code(&FLAG_wasm_shared_code, true); - TestTransferrableWasmModules(true); -} - #undef EMIT_CODE_WITH_END } // namespace test_wasm_serialization |