Skip to content

Commit

Permalink
deps: V8: cherry-pick bde7ee5473d6
Browse files Browse the repository at this point in the history
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 <omerkatz@chromium.org>
    Commit-Queue: Michaël Zasso <mic.besace@gmail.com>
    Cr-Commit-Position: refs/heads/master@{#71473}

Refs: v8/v8@bde7ee5

PR-URL: #36139
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Myles Borins <myles.borins@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
  • Loading branch information
targos committed Feb 11, 2021
1 parent 3046131 commit 2dad8d4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
2 changes: 1 addition & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -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 #####

Expand Down
4 changes: 2 additions & 2 deletions deps/v8/src/heap/cppgc-js/cpp-heap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,15 @@ class UnifiedHeapConcurrentMarker
unified_heap_marking_state_(unified_heap_marking_state) {}

std::unique_ptr<cppgc::Visitor> CreateConcurrentMarkingVisitor(
ConcurrentMarkingState&) const final;
cppgc::internal::ConcurrentMarkingState&) const final;

private:
UnifiedHeapMarkingState& unified_heap_marking_state_;
};

std::unique_ptr<cppgc::Visitor>
UnifiedHeapConcurrentMarker::CreateConcurrentMarkingVisitor(
ConcurrentMarkingState& marking_state) const {
cppgc::internal::ConcurrentMarkingState& marking_state) const {
return std::make_unique<ConcurrentUnifiedHeapMarkingVisitor>(
heap(), marking_state, unified_heap_marking_state_);
}
Expand Down
6 changes: 3 additions & 3 deletions deps/v8/src/heap/cppgc-js/unified-heap-marking-visitor.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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) {}
Expand All @@ -99,7 +99,7 @@ bool ConcurrentUnifiedHeapMarkingVisitor::DeferTraceToMutatorThreadIfConcurrent(
size_t deferred_size) {
marking_state_.concurrent_marking_bailout_worklist().Push(
{parameter, callback, deferred_size});
static_cast<ConcurrentMarkingState&>(marking_state_)
static_cast<cppgc::internal::ConcurrentMarkingState&>(marking_state_)
.AccountDeferredMarkedBytes(deferred_size);
return true;
}
Expand Down
9 changes: 4 additions & 5 deletions deps/v8/src/heap/cppgc-js/unified-heap-marking-visitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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_;
};

Expand All @@ -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;

Expand Down

0 comments on commit 2dad8d4

Please sign in to comment.