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) {
class YoungGenerationMarkingVisitor final
: public NewSpaceVisitor<YoungGenerationMarkingVisitor> {
public:
YoungGenerationMarkingVisitor(
Isolate* isolate, MarkingState* marking_state,
MinorMarkCompactCollector::MarkingWorklist::Local* worklist_local)
YoungGenerationMarkingVisitor(Isolate* isolate, MarkingState* marking_state,
MarkingWorklist::Local* worklist_local)
: NewSpaceVisitor(isolate),
worklist_local_(worklist_local),
marking_state_(marking_state) {}
......@@ -5413,7 +5412,7 @@ class YoungGenerationMarkingVisitor final
}
}
MinorMarkCompactCollector::MarkingWorklist::Local* worklist_local_;
MarkingWorklist::Local* worklist_local_;
MarkingState* marking_state_;
};
......@@ -5426,7 +5425,7 @@ constexpr size_t MinorMarkCompactCollector::kMaxParallelTasks;
MinorMarkCompactCollector::MinorMarkCompactCollector(Heap* heap)
: heap_(heap),
worklist_(new MinorMarkCompactCollector::MarkingWorklist()),
worklist_(new MarkingWorklist()),
main_thread_worklist_local_(worklist_),
marking_state_(heap->isolate()),
non_atomic_marking_state_(heap->isolate()),
......@@ -5833,9 +5832,9 @@ class YoungGenerationMarkingTask;
class YoungGenerationMarkingTask {
public:
YoungGenerationMarkingTask(
Isolate* isolate, MinorMarkCompactCollector* collector,
MinorMarkCompactCollector::MarkingWorklist* global_worklist)
YoungGenerationMarkingTask(Isolate* isolate,
MinorMarkCompactCollector* collector,
MarkingWorklist* global_worklist)
: marking_worklist_local_(global_worklist),
marking_state_(collector->marking_state()),
visitor_(isolate, marking_state_, &marking_worklist_local_) {}
......@@ -5856,7 +5855,7 @@ class YoungGenerationMarkingTask {
}
private:
MinorMarkCompactCollector::MarkingWorklist::Local marking_worklist_local_;
MarkingWorklist::Local marking_worklist_local_;
MarkingState* marking_state_;
YoungGenerationMarkingVisitor visitor_;
};
......@@ -5926,9 +5925,9 @@ class PageMarkingItem : public ParallelWorkItem {
class YoungGenerationMarkingJob : public v8::JobTask {
public:
YoungGenerationMarkingJob(
Isolate* isolate, MinorMarkCompactCollector* collector,
MinorMarkCompactCollector::MarkingWorklist* global_worklist,
YoungGenerationMarkingJob(Isolate* isolate,
MinorMarkCompactCollector* collector,
MarkingWorklist* global_worklist,
std::vector<PageMarkingItem> marking_items)
: isolate_(isolate),
collector_(collector),
......@@ -5998,7 +5997,7 @@ class YoungGenerationMarkingJob : public v8::JobTask {
Isolate* isolate_;
MinorMarkCompactCollector* collector_;
MinorMarkCompactCollector::MarkingWorklist* global_worklist_;
MarkingWorklist* global_worklist_;
std::vector<PageMarkingItem> marking_items_;
std::atomic_size_t remaining_marking_items_{0};
IndexGenerator generator_;
......
......@@ -782,8 +782,6 @@ class MinorMarkCompactCollector final {
MemoryChunk* chunk, RememberedSetUpdatingMode updating_mode);
private:
using MarkingWorklist =
::heap::base::Worklist<HeapObject, 64 /* segment size */>;
class RootMarkingVisitor;
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