From 2dad8d43ccf65d6ecb1e7be12da67568aae82627 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Zasso?= Date: Tue, 8 Dec 2020 08:06:53 +0100 Subject: [PATCH] deps: V8: cherry-pick bde7ee5473d6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Original commit message: cppgc: avoid multiple class declarations ConcurrentMarkingState and MarkingStateBase are already defined in the This change fixes compilation with MSVC. v8: :internal namespace. Change-Id: Ib8a1370a0a27a90e385fd69e61036e263e1489e6 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2562671 Reviewed-by: Omer Katz Commit-Queue: Michaƫl Zasso Cr-Commit-Position: refs/heads/master@{#71473} Refs: https://github.com/v8/v8/commit/bde7ee5473d645c735e7d226e7eff298a826ef23 PR-URL: https://github.com/nodejs/node/pull/36139 Reviewed-By: Jiawen Geng Reviewed-By: Colin Ihrig Reviewed-By: Myles Borins Reviewed-By: Shelley Vohr --- common.gypi | 2 +- deps/v8/src/heap/cppgc-js/cpp-heap.cc | 4 ++-- .../v8/src/heap/cppgc-js/unified-heap-marking-visitor.cc | 6 +++--- deps/v8/src/heap/cppgc-js/unified-heap-marking-visitor.h | 9 ++++----- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/common.gypi b/common.gypi index 2eb8664697d990..2a82642e350028 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.14', + 'v8_embedder_string': '-node.15', ##### V8 defaults for Node.js ##### diff --git a/deps/v8/src/heap/cppgc-js/cpp-heap.cc b/deps/v8/src/heap/cppgc-js/cpp-heap.cc index 712be09f2c3880..8ad35749783bc1 100644 --- a/deps/v8/src/heap/cppgc-js/cpp-heap.cc +++ b/deps/v8/src/heap/cppgc-js/cpp-heap.cc @@ -81,7 +81,7 @@ class UnifiedHeapConcurrentMarker unified_heap_marking_state_(unified_heap_marking_state) {} std::unique_ptr CreateConcurrentMarkingVisitor( - ConcurrentMarkingState&) const final; + cppgc::internal::ConcurrentMarkingState&) const final; private: UnifiedHeapMarkingState& unified_heap_marking_state_; @@ -89,7 +89,7 @@ class UnifiedHeapConcurrentMarker std::unique_ptr UnifiedHeapConcurrentMarker::CreateConcurrentMarkingVisitor( - ConcurrentMarkingState& marking_state) const { + cppgc::internal::ConcurrentMarkingState& marking_state) const { return std::make_unique( heap(), marking_state, unified_heap_marking_state_); } diff --git a/deps/v8/src/heap/cppgc-js/unified-heap-marking-visitor.cc b/deps/v8/src/heap/cppgc-js/unified-heap-marking-visitor.cc index e235f8885d96f7..16543fe01929fb 100644 --- a/deps/v8/src/heap/cppgc-js/unified-heap-marking-visitor.cc +++ b/deps/v8/src/heap/cppgc-js/unified-heap-marking-visitor.cc @@ -14,7 +14,7 @@ namespace v8 { namespace internal { UnifiedHeapMarkingVisitorBase::UnifiedHeapMarkingVisitorBase( - HeapBase& heap, MarkingStateBase& marking_state, + HeapBase& heap, cppgc::internal::MarkingStateBase& marking_state, UnifiedHeapMarkingState& unified_heap_marking_state) : JSVisitor(cppgc::internal::VisitorFactory::CreateKey()), marking_state_(marking_state), @@ -89,7 +89,7 @@ void MutatorUnifiedHeapMarkingVisitor::VisitWeakRoot(const void* object, } ConcurrentUnifiedHeapMarkingVisitor::ConcurrentUnifiedHeapMarkingVisitor( - HeapBase& heap, ConcurrentMarkingState& marking_state, + HeapBase& heap, cppgc::internal::ConcurrentMarkingState& marking_state, UnifiedHeapMarkingState& unified_heap_marking_state) : UnifiedHeapMarkingVisitorBase(heap, marking_state, unified_heap_marking_state) {} @@ -99,7 +99,7 @@ bool ConcurrentUnifiedHeapMarkingVisitor::DeferTraceToMutatorThreadIfConcurrent( size_t deferred_size) { marking_state_.concurrent_marking_bailout_worklist().Push( {parameter, callback, deferred_size}); - static_cast(marking_state_) + static_cast(marking_state_) .AccountDeferredMarkedBytes(deferred_size); return true; } diff --git a/deps/v8/src/heap/cppgc-js/unified-heap-marking-visitor.h b/deps/v8/src/heap/cppgc-js/unified-heap-marking-visitor.h index 05e3affaa804c4..1032a760068cea 100644 --- a/deps/v8/src/heap/cppgc-js/unified-heap-marking-visitor.h +++ b/deps/v8/src/heap/cppgc-js/unified-heap-marking-visitor.h @@ -28,14 +28,12 @@ namespace internal { using cppgc::SourceLocation; using cppgc::TraceDescriptor; using cppgc::WeakCallback; -using cppgc::internal::ConcurrentMarkingState; using cppgc::internal::HeapBase; -using cppgc::internal::MarkingStateBase; using cppgc::internal::MutatorMarkingState; class V8_EXPORT_PRIVATE UnifiedHeapMarkingVisitorBase : public JSVisitor { public: - UnifiedHeapMarkingVisitorBase(HeapBase&, MarkingStateBase&, + UnifiedHeapMarkingVisitorBase(HeapBase&, cppgc::internal::MarkingStateBase&, UnifiedHeapMarkingState&); ~UnifiedHeapMarkingVisitorBase() override = default; @@ -53,7 +51,7 @@ class V8_EXPORT_PRIVATE UnifiedHeapMarkingVisitorBase : public JSVisitor { // JS handling. void Visit(const TracedReferenceBase& ref) final; - MarkingStateBase& marking_state_; + cppgc::internal::MarkingStateBase& marking_state_; UnifiedHeapMarkingState& unified_heap_marking_state_; }; @@ -73,7 +71,8 @@ class V8_EXPORT_PRIVATE MutatorUnifiedHeapMarkingVisitor final class V8_EXPORT_PRIVATE ConcurrentUnifiedHeapMarkingVisitor final : public UnifiedHeapMarkingVisitorBase { public: - ConcurrentUnifiedHeapMarkingVisitor(HeapBase&, ConcurrentMarkingState&, + ConcurrentUnifiedHeapMarkingVisitor(HeapBase&, + cppgc::internal::ConcurrentMarkingState&, UnifiedHeapMarkingState&); ~ConcurrentUnifiedHeapMarkingVisitor() override = default;