diff options
author | Bartosz Sosnowski <bartosz@janeasystems.com> | 2017-05-23 18:25:03 +0200 |
---|---|---|
committer | Michaƫl Zasso <targos@protonmail.com> | 2017-06-07 10:34:17 +0200 |
commit | bfb4694408434b631bf5cfbca756fc9cb331e91c (patch) | |
tree | dfb6b05ff789bda9a5defbb368621ea6838b788c /deps | |
parent | bc8e4878c007f044425bbdd8f0dff7006d0028a0 (diff) | |
download | android-node-v8-bfb4694408434b631bf5cfbca756fc9cb331e91c.tar.gz android-node-v8-bfb4694408434b631bf5cfbca756fc9cb331e91c.tar.bz2 android-node-v8-bfb4694408434b631bf5cfbca756fc9cb331e91c.zip |
deps: fix addons compilation with VS2013
VS2013 does not support defaulting move constructor and assignment
operator. This adds explicit definitions of those methods for two
classes.
This fix is required because we still support building addons with
VS2013 and the incompatibility is in v8.h.
Fixes: https://github.com/nodejs/node-v8/issues/4
PR-URL: https://github.com/nodejs/node/pull/13263
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Franziska Hinkelmann <franziska.hinkelmann@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Diffstat (limited to 'deps')
-rw-r--r-- | deps/v8/include/v8.h | 12 | ||||
-rw-r--r-- | deps/v8/src/api.cc | 15 |
2 files changed, 23 insertions, 4 deletions
diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 1dd4ace540..ea4119abed 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<Buffer> received_buffers_; size_t total_size_ = 0; diff --git a/deps/v8/src/api.cc b/deps/v8/src/api.cc index 818d1f3e87..a742436ebc 100644 --- a/deps/v8/src/api.cc +++ b/deps/v8/src/api.cc @@ -7591,6 +7591,14 @@ Local<String> WasmCompiledModule::GetWasmWireBytes() { return Local<String>::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 @@ -7705,6 +7713,13 @@ MaybeLocal<WasmCompiledModule> 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(); |