From 706abac817706b3e4cc80b45d11115f0cdfdc0ad Mon Sep 17 00:00:00 2001 From: Jiawen Geng Date: Wed, 14 Oct 2020 12:22:20 +0000 Subject: [PATCH] deps: fix V8 build issue with inline methods MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/35415 Reviewed-By: Rich Trott Reviewed-By: Jiawen Geng Reviewed-By: Daniel Bevenius Reviewed-By: Matteo Collina Reviewed-By: Myles Borins deps: patch for v8 on windows PR-URL: https://github.com/nodejs/node/pull/40010 Reviewed-By: Michaël Zasso Reviewed-By: James M Snell deps: patch v8 for vs2019 in std17 PR-URL: https://github.com/nodejs/node/pull/40060 Reviewed-By: Richard Lau Reviewed-By: James M Snell Reviewed-By: Michaël Zasso deps: workaround debug link error on Windows PR-URL: https://github.com/nodejs/node/pull/38807 Refs: https://github.com/nodejs/node/pull/38788 Reviewed-By: Antoine du Hamel Reviewed-By: Jiawen Geng Reviewed-By: James M Snell Reviewed-By: Juan José Arboleda Reviewed-By: Michaël Zasso Reviewed-By: Ash Cripps --- common.gypi | 2 +- deps/v8/src/objects/fixed-array-inl.h | 2 ++ deps/v8/src/objects/fixed-array.h | 13 +++++++++++++ deps/v8/src/objects/tagged-field.h | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/common.gypi b/common.gypi index a7ad583d6d4..514939d2087 100644 --- a/common.gypi +++ b/common.gypi @@ -36,7 +36,7 @@ # Reset this number to 0 on major V8 upgrades. # Increment by one for each non-official patch applied to deps/v8. - 'v8_embedder_string': '-node.4', + 'v8_embedder_string': '-node.5', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/objects/fixed-array-inl.h b/deps/v8/src/objects/fixed-array-inl.h index 98315ad73de..dbf0222b845 100644 --- a/deps/v8/src/objects/fixed-array-inl.h +++ b/deps/v8/src/objects/fixed-array-inl.h @@ -84,6 +84,7 @@ bool FixedArray::is_the_hole(Isolate* isolate, int index) { return get(isolate, index).IsTheHole(isolate); } +#if !defined(_WIN32) || (defined(_WIN64) && _MSC_VER < 1930 && __cplusplus < 201703L) void FixedArray::set(int index, Smi value) { DCHECK_NE(map(), GetReadOnlyRoots().fixed_cow_array_map()); DCHECK_LT(static_cast(index), static_cast(length())); @@ -91,6 +92,7 @@ void FixedArray::set(int index, Smi value) { int offset = OffsetOfElementAt(index); RELAXED_WRITE_FIELD(*this, offset, value); } +#endif void FixedArray::set(int index, Object value) { DCHECK_NE(GetReadOnlyRoots().fixed_cow_array_map(), map()); diff --git a/deps/v8/src/objects/fixed-array.h b/deps/v8/src/objects/fixed-array.h index c5b888d2cfc..041cf80da64 100644 --- a/deps/v8/src/objects/fixed-array.h +++ b/deps/v8/src/objects/fixed-array.h @@ -134,7 +134,20 @@ class FixedArray inline bool is_the_hole(Isolate* isolate, int index); // Setter that doesn't need write barrier. +#if !defined(_WIN32) || (defined(_WIN64) && _MSC_VER < 1930 && __cplusplus < 201703L) inline void set(int index, Smi value); +#else + inline void set(int index, Smi value) { +#if !defined(_WIN32) + DCHECK_NE(map(), GetReadOnlyRoots().fixed_cow_array_map()); +#endif + DCHECK_LT(static_cast(index), static_cast(length())); + DCHECK(Object(value).IsSmi()); + int offset = OffsetOfElementAt(index); + RELAXED_WRITE_FIELD(*this, offset, value); + } +#endif + // Setter with explicit barrier mode. inline void set(int index, Object value, WriteBarrierMode mode); diff --git a/deps/v8/src/objects/tagged-field.h b/deps/v8/src/objects/tagged-field.h index d9fc0bb1027..7faf9e9ac95 100644 --- a/deps/v8/src/objects/tagged-field.h +++ b/deps/v8/src/objects/tagged-field.h @@ -49,7 +49,7 @@ class TaggedField : public AllStatic { int offset = 0); static inline void Relaxed_Store(HeapObject host, T value); - static inline void Relaxed_Store(HeapObject host, int offset, T value); + static void Relaxed_Store(HeapObject host, int offset, T value); static inline T Acquire_Load(HeapObject host, int offset = 0); static inline T Acquire_Load_No_Unpack(PtrComprCageBase cage_base,