diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 1dd4ace540dd24..ea4119abed29de 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -4025,10 +4025,12 @@ class V8_EXPORT WasmCompiledModule : public Object { // supports move semantics, and does not support copy semantics. class TransferrableModule final { public: - TransferrableModule(TransferrableModule&& src) = default; + TransferrableModule(TransferrableModule&& src) + : compiled_code(std::move(src.compiled_code)), + wire_bytes(std::move(src.wire_bytes)) {} TransferrableModule(const TransferrableModule& src) = delete; - TransferrableModule& operator=(TransferrableModule&& src) = default; + TransferrableModule& operator=(TransferrableModule&& src); TransferrableModule& operator=(const TransferrableModule& src) = delete; private: @@ -4101,9 +4103,11 @@ class V8_EXPORT WasmModuleObjectBuilder final { // Disable copy semantics *in this implementation*. We can choose to // relax this, albeit it's not clear why. WasmModuleObjectBuilder(const WasmModuleObjectBuilder&) = delete; - WasmModuleObjectBuilder(WasmModuleObjectBuilder&&) = default; + WasmModuleObjectBuilder(WasmModuleObjectBuilder&& src) + : received_buffers_(std::move(src.received_buffers_)), + total_size_(src.total_size_) {} WasmModuleObjectBuilder& operator=(const WasmModuleObjectBuilder&) = delete; - WasmModuleObjectBuilder& operator=(WasmModuleObjectBuilder&&) = default; + WasmModuleObjectBuilder& operator=(WasmModuleObjectBuilder&&); std::vector received_buffers_; size_t total_size_ = 0; diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index 58094c1f68d786..8e0b0a8a1e6727 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -7592,6 +7592,14 @@ Local WasmCompiledModule::GetWasmWireBytes() { return Local::Cast(Utils::ToLocal(wire_bytes)); } +WasmCompiledModule::TransferrableModule& +WasmCompiledModule::TransferrableModule::operator=( + TransferrableModule&& src) { + compiled_code = std::move(src.compiled_code); + wire_bytes = std::move(src.wire_bytes); + return *this; +} + // Currently, wasm modules are bound, both to Isolate and to // the Context they were created in. The currently-supported means to // decontextualize and then re-contextualize a module is via @@ -7706,6 +7714,13 @@ MaybeLocal WasmModuleObjectBuilder::Finish() { return WasmCompiledModule::Compile(isolate_, wire_bytes.get(), total_size_); } +WasmModuleObjectBuilder& +WasmModuleObjectBuilder::operator=(WasmModuleObjectBuilder&& src) { + received_buffers_ = std::move(src.received_buffers_); + total_size_ = src.total_size_; + return *this; +} + // static v8::ArrayBuffer::Allocator* v8::ArrayBuffer::Allocator::NewDefaultAllocator() { return new ArrayBufferAllocator();