Commit debec016 authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[heap] IncrementalMarking: Simplifiy MarkingWorklist handling

Bug: 
Change-Id: I0eb97474acaed7180bf90a47a9761df466d7e0a2
Reviewed-on: https://chromium-review.googlesource.com/716037Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#48501}
parent 14456475
......@@ -5383,10 +5383,9 @@ bool Heap::SetUp() {
store_buffer_ = new StoreBuffer(this);
mark_compact_collector_ = new MarkCompactCollector(this);
incremental_marking_ = new IncrementalMarking(this);
incremental_marking_ =
new IncrementalMarking(this, mark_compact_collector_->marking_worklist());
incremental_marking_->set_marking_worklist(
mark_compact_collector_->marking_worklist());
if (FLAG_concurrent_marking) {
MarkCompactCollector::MarkingWorklist* marking_worklist =
mark_compact_collector_->marking_worklist();
......
......@@ -45,9 +45,10 @@ void IncrementalMarking::Observer::Step(int bytes_allocated, Address addr,
}
}
IncrementalMarking::IncrementalMarking(Heap* heap)
IncrementalMarking::IncrementalMarking(
Heap* heap, MarkCompactCollector::MarkingWorklist* marking_worklist)
: heap_(heap),
marking_worklist_(nullptr),
marking_worklist_(marking_worklist),
initial_old_generation_size_(0),
bytes_marked_ahead_of_schedule_(0),
unscanned_bytes_of_large_object_(0),
......@@ -60,6 +61,7 @@ IncrementalMarking::IncrementalMarking(Heap* heap)
request_type_(NONE),
new_generation_observer_(*this, kYoungGenerationAllocatedThreshold),
old_generation_observer_(*this, kOldGenerationAllocatedThreshold) {
DCHECK_NOT_NULL(marking_worklist_);
SetState(STOPPED);
}
......
......@@ -107,7 +107,8 @@ class V8_EXPORT_PRIVATE IncrementalMarking {
static const AccessMode kAtomicity = AccessMode::NON_ATOMIC;
#endif
explicit IncrementalMarking(Heap* heap);
IncrementalMarking(Heap* heap,
MarkCompactCollector::MarkingWorklist* marking_worklist);
MarkingState* marking_state() { return &marking_state_; }
......@@ -273,16 +274,10 @@ class V8_EXPORT_PRIVATE IncrementalMarking {
void AbortBlackAllocation();
MarkCompactCollector::MarkingWorklist* marking_worklist() {
SLOW_DCHECK(marking_worklist_ != nullptr);
MarkCompactCollector::MarkingWorklist* marking_worklist() const {
return marking_worklist_;
}
void set_marking_worklist(
MarkCompactCollector::MarkingWorklist* marking_worklist) {
marking_worklist_ = marking_worklist;
}
void Deactivate();
private:
......@@ -345,8 +340,8 @@ class V8_EXPORT_PRIVATE IncrementalMarking {
heap_->SetIsMarkingFlag(s >= MARKING);
}
Heap* heap_;
MarkCompactCollector::MarkingWorklist* marking_worklist_;
Heap* const heap_;
MarkCompactCollector::MarkingWorklist* const marking_worklist_;
double start_time_ms_;
size_t initial_old_generation_size_;
......
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