Commit f6bf7cdb authored by Omer Katz's avatar Omer Katz Committed by V8 LUCI CQ

[heap] Deduplicate MarkingWorklist

MarkingWorklists and MinorMarkCompactCollector each had their own
definition of MarkingWorklist. Both definition are identical.
Drop MinorMarkCompactCollector's definition.

Bug: v8:12612
Change-Id: I890f263e4de702aa34f00626a3aaa3ffb29c1ff2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3740723
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#81493}
parent a40a0850
...@@ -5337,9 +5337,8 @@ bool IsUnmarkedObjectForYoungGeneration(Heap* heap, FullObjectSlot p) { ...@@ -5337,9 +5337,8 @@ bool IsUnmarkedObjectForYoungGeneration(Heap* heap, FullObjectSlot p) {
class YoungGenerationMarkingVisitor final class YoungGenerationMarkingVisitor final
: public NewSpaceVisitor<YoungGenerationMarkingVisitor> { : public NewSpaceVisitor<YoungGenerationMarkingVisitor> {
public: public:
YoungGenerationMarkingVisitor( YoungGenerationMarkingVisitor(Isolate* isolate, MarkingState* marking_state,
Isolate* isolate, MarkingState* marking_state, MarkingWorklist::Local* worklist_local)
MinorMarkCompactCollector::MarkingWorklist::Local* worklist_local)
: NewSpaceVisitor(isolate), : NewSpaceVisitor(isolate),
worklist_local_(worklist_local), worklist_local_(worklist_local),
marking_state_(marking_state) {} marking_state_(marking_state) {}
...@@ -5413,7 +5412,7 @@ class YoungGenerationMarkingVisitor final ...@@ -5413,7 +5412,7 @@ class YoungGenerationMarkingVisitor final
} }
} }
MinorMarkCompactCollector::MarkingWorklist::Local* worklist_local_; MarkingWorklist::Local* worklist_local_;
MarkingState* marking_state_; MarkingState* marking_state_;
}; };
...@@ -5426,7 +5425,7 @@ constexpr size_t MinorMarkCompactCollector::kMaxParallelTasks; ...@@ -5426,7 +5425,7 @@ constexpr size_t MinorMarkCompactCollector::kMaxParallelTasks;
MinorMarkCompactCollector::MinorMarkCompactCollector(Heap* heap) MinorMarkCompactCollector::MinorMarkCompactCollector(Heap* heap)
: heap_(heap), : heap_(heap),
worklist_(new MinorMarkCompactCollector::MarkingWorklist()), worklist_(new MarkingWorklist()),
main_thread_worklist_local_(worklist_), main_thread_worklist_local_(worklist_),
marking_state_(heap->isolate()), marking_state_(heap->isolate()),
non_atomic_marking_state_(heap->isolate()), non_atomic_marking_state_(heap->isolate()),
...@@ -5833,9 +5832,9 @@ class YoungGenerationMarkingTask; ...@@ -5833,9 +5832,9 @@ class YoungGenerationMarkingTask;
class YoungGenerationMarkingTask { class YoungGenerationMarkingTask {
public: public:
YoungGenerationMarkingTask( YoungGenerationMarkingTask(Isolate* isolate,
Isolate* isolate, MinorMarkCompactCollector* collector, MinorMarkCompactCollector* collector,
MinorMarkCompactCollector::MarkingWorklist* global_worklist) MarkingWorklist* global_worklist)
: marking_worklist_local_(global_worklist), : marking_worklist_local_(global_worklist),
marking_state_(collector->marking_state()), marking_state_(collector->marking_state()),
visitor_(isolate, marking_state_, &marking_worklist_local_) {} visitor_(isolate, marking_state_, &marking_worklist_local_) {}
...@@ -5856,7 +5855,7 @@ class YoungGenerationMarkingTask { ...@@ -5856,7 +5855,7 @@ class YoungGenerationMarkingTask {
} }
private: private:
MinorMarkCompactCollector::MarkingWorklist::Local marking_worklist_local_; MarkingWorklist::Local marking_worklist_local_;
MarkingState* marking_state_; MarkingState* marking_state_;
YoungGenerationMarkingVisitor visitor_; YoungGenerationMarkingVisitor visitor_;
}; };
...@@ -5926,10 +5925,10 @@ class PageMarkingItem : public ParallelWorkItem { ...@@ -5926,10 +5925,10 @@ class PageMarkingItem : public ParallelWorkItem {
class YoungGenerationMarkingJob : public v8::JobTask { class YoungGenerationMarkingJob : public v8::JobTask {
public: public:
YoungGenerationMarkingJob( YoungGenerationMarkingJob(Isolate* isolate,
Isolate* isolate, MinorMarkCompactCollector* collector, MinorMarkCompactCollector* collector,
MinorMarkCompactCollector::MarkingWorklist* global_worklist, MarkingWorklist* global_worklist,
std::vector<PageMarkingItem> marking_items) std::vector<PageMarkingItem> marking_items)
: isolate_(isolate), : isolate_(isolate),
collector_(collector), collector_(collector),
global_worklist_(global_worklist), global_worklist_(global_worklist),
...@@ -5998,7 +5997,7 @@ class YoungGenerationMarkingJob : public v8::JobTask { ...@@ -5998,7 +5997,7 @@ class YoungGenerationMarkingJob : public v8::JobTask {
Isolate* isolate_; Isolate* isolate_;
MinorMarkCompactCollector* collector_; MinorMarkCompactCollector* collector_;
MinorMarkCompactCollector::MarkingWorklist* global_worklist_; MarkingWorklist* global_worklist_;
std::vector<PageMarkingItem> marking_items_; std::vector<PageMarkingItem> marking_items_;
std::atomic_size_t remaining_marking_items_{0}; std::atomic_size_t remaining_marking_items_{0};
IndexGenerator generator_; IndexGenerator generator_;
......
...@@ -782,8 +782,6 @@ class MinorMarkCompactCollector final { ...@@ -782,8 +782,6 @@ class MinorMarkCompactCollector final {
MemoryChunk* chunk, RememberedSetUpdatingMode updating_mode); MemoryChunk* chunk, RememberedSetUpdatingMode updating_mode);
private: private:
using MarkingWorklist =
::heap::base::Worklist<HeapObject, 64 /* segment size */>;
class RootMarkingVisitor; class RootMarkingVisitor;
static const int kNumMarkers = 8; static const int kNumMarkers = 8;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment