From c3440a8003ea22dfededae098f62f2f46bb8737d Mon Sep 17 00:00:00 2001 From: Clemens Backes Date: Fri, 18 Oct 2019 16:18:36 +0200 Subject: [PATCH] src: remove uses of deprecated wasm TransferrableModule WasmModuleObject::TransferrableModule is deprecated and will be removed in V8 v8.0. Replace all uses by CompiledWasmModule. Refs: https://github.com/v8/node/pull/101 --- src/node_messaging.cc | 11 ++++++----- src/node_messaging.h | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/node_messaging.cc b/src/node_messaging.cc index c2a2063381ddf1..6645ca025b57db 100644 --- a/src/node_messaging.cc +++ b/src/node_messaging.cc @@ -13,6 +13,7 @@ using node::contextify::ContextifyContext; using v8::Array; using v8::ArrayBuffer; using v8::BackingStore; +using v8::CompiledWasmModule; using v8::Context; using v8::EscapableHandleScope; using v8::Exception; @@ -58,7 +59,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate { Environment* env, const std::vector& message_ports, const std::vector>& shared_array_buffers, - const std::vector& wasm_modules) + const std::vector& wasm_modules) : message_ports_(message_ports), shared_array_buffers_(shared_array_buffers), wasm_modules_(wasm_modules) {} @@ -82,7 +83,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate { MaybeLocal GetWasmModuleFromId( Isolate* isolate, uint32_t transfer_id) override { CHECK_LE(transfer_id, wasm_modules_.size()); - return WasmModuleObject::FromTransferrableModule( + return WasmModuleObject::FromCompiledModule( isolate, wasm_modules_[transfer_id]); } @@ -91,7 +92,7 @@ class DeserializerDelegate : public ValueDeserializer::Delegate { private: const std::vector& message_ports_; const std::vector>& shared_array_buffers_; - const std::vector& wasm_modules_; + const std::vector& wasm_modules_; }; } // anonymous namespace @@ -162,7 +163,7 @@ void Message::AddMessagePort(std::unique_ptr&& data) { message_ports_.emplace_back(std::move(data)); } -uint32_t Message::AddWASMModule(WasmModuleObject::TransferrableModule&& mod) { +uint32_t Message::AddWASMModule(CompiledWasmModule&& mod) { wasm_modules_.emplace_back(std::move(mod)); return wasm_modules_.size() - 1; } @@ -238,7 +239,7 @@ class SerializerDelegate : public ValueSerializer::Delegate { Maybe GetWasmModuleTransferId( Isolate* isolate, Local module) override { - return Just(msg_->AddWASMModule(module->GetTransferrableModule())); + return Just(msg_->AddWASMModule(module->GetCompiledModule())); } void Finish() { diff --git a/src/node_messaging.h b/src/node_messaging.h index 32eedfb34f917b..526158e144d354 100644 --- a/src/node_messaging.h +++ b/src/node_messaging.h @@ -57,7 +57,7 @@ class Message : public MemoryRetainer { void AddMessagePort(std::unique_ptr&& data); // Internal method of Message that is called when a new WebAssembly.Module // object is encountered in the incoming value's structure. - uint32_t AddWASMModule(v8::WasmModuleObject::TransferrableModule&& mod); + uint32_t AddWASMModule(v8::CompiledWasmModule&& mod); // The MessagePorts that will be transferred, as recorded by Serialize(). // Used for warning user about posting the target MessagePort to itself, @@ -76,7 +76,7 @@ class Message : public MemoryRetainer { std::vector> array_buffers_; std::vector> shared_array_buffers_; std::vector> message_ports_; - std::vector wasm_modules_; + std::vector wasm_modules_; friend class MessagePort; };