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

Revert "[heap] Move ArrayBufferTracker updating to pointers updating"

This reverts commit 4260f605.

Reason for revert: Speculative revert for https://build.chromium.org/p/client.v8/builders/V8%20Linux64%20ASAN

Original change's description:
> [heap] Move ArrayBufferTracker updating to pointers updating
> 
> Bug: chromium:651354
> Change-Id: I2c318dd3cb0885fd8186d4c13a91840498a217b2
> Reviewed-on: https://chromium-review.googlesource.com/550097
> Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
> Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#46269}

TBR=ulan@chromium.org,mlippautz@chromium.org

Change-Id: Ie5b828f909e140bf5b4b17353999d598e6367622
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:651354
Reviewed-on: https://chromium-review.googlesource.com/552177Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#46274}
parent 4e06f963
......@@ -3490,6 +3490,7 @@ class Evacuator : public Malloced {
if (chunk->IsFlagSet(MemoryChunk::PAGE_NEW_NEW_PROMOTION))
return kPageNewToNew;
if (chunk->InNewSpace()) return kObjectsNewToOld;
DCHECK(chunk->IsEvacuationCandidate());
return kObjectsOldToOld;
}
......@@ -3627,7 +3628,8 @@ void FullEvacuator::RawEvacuatePage(Page* page, intptr_t* live_bytes) {
case kObjectsNewToOld:
LiveObjectVisitor::VisitBlackObjectsNoFail(
page, state, &new_space_visitor_, LiveObjectVisitor::kClearMarkbits);
// ArrayBufferTracker will be updated during pointers updating.
ArrayBufferTracker::ProcessBuffers(
page, ArrayBufferTracker::kUpdateForwardedRemoveOthers);
break;
case kPageNewToOld:
LiveObjectVisitor::VisitBlackObjectsNoFail(
......@@ -3652,7 +3654,8 @@ void FullEvacuator::RawEvacuatePage(Page* page, intptr_t* live_bytes) {
// thread for simplicity reasons.
collector_->ReportAbortedEvacuationCandidate(failed_object, page);
} else {
// ArrayBufferTracker will be updated during pointers updating.
ArrayBufferTracker::ProcessBuffers(
page, ArrayBufferTracker::kUpdateForwardedRemoveOthers);
}
break;
}
......@@ -3679,7 +3682,8 @@ void YoungGenerationEvacuator::RawEvacuatePage(Page* page,
case kObjectsNewToOld:
LiveObjectVisitor::VisitGreyObjectsNoFail(
page, state, &new_space_visitor_, LiveObjectVisitor::kClearMarkbits);
// ArrayBufferTracker will be updated during pointers updating.
ArrayBufferTracker::ProcessBuffers(
page, ArrayBufferTracker::kUpdateForwardedRemoveOthers);
break;
case kPageNewToOld:
LiveObjectVisitor::VisitGreyObjectsNoFail(
......@@ -4420,25 +4424,6 @@ class GlobalHandlesUpdatingItem : public UpdatingItem {
size_t end_;
};
// Update array buffers on a page that has been evacuated by copying objects.
// Target page exclusivity in old space is guaranteed by the fact that
// evacuation tasks either (a) retrieved a fresh page, or (b) retrieved all
// free list items of a given page. For new space the tracker will update
// using a lock.
class ArrayBufferTrackerUpdatingItem : public UpdatingItem {
public:
explicit ArrayBufferTrackerUpdatingItem(Page* page) : page_(page) {}
virtual ~ArrayBufferTrackerUpdatingItem() {}
void Process() override {
ArrayBufferTracker::ProcessBuffers(
page_, ArrayBufferTracker::kUpdateForwardedRemoveOthers);
}
private:
Page* page_;
};
int MarkCompactCollectorBase::CollectToSpaceUpdatingItems(
ItemParallelJob* job) {
// Seed to space pages.
......@@ -4485,34 +4470,6 @@ int MarkCompactCollectorBase::CollectRememberedSetUpdatingItems(
: NumberOfParallelPointerUpdateTasks(pages, old_to_new_slots_);
}
void MinorMarkCompactCollector::CollectNewSpaceArrayBufferTrackerItems(
ItemParallelJob* job) {
for (Page* p : new_space_evacuation_pages_) {
if (Evacuator::ComputeEvacuationMode(p) == Evacuator::kObjectsNewToOld) {
job->AddItem(new ArrayBufferTrackerUpdatingItem(p));
}
}
}
void MarkCompactCollector::CollectNewSpaceArrayBufferTrackerItems(
ItemParallelJob* job) {
for (Page* p : new_space_evacuation_pages_) {
if (Evacuator::ComputeEvacuationMode(p) == Evacuator::kObjectsNewToOld) {
job->AddItem(new ArrayBufferTrackerUpdatingItem(p));
}
}
}
void MarkCompactCollector::CollectOldSpaceArrayBufferTrackerItems(
ItemParallelJob* job) {
for (Page* p : old_space_evacuation_pages_) {
if (Evacuator::ComputeEvacuationMode(p) == Evacuator::kObjectsOldToOld &&
p->IsEvacuationCandidate()) {
job->AddItem(new ArrayBufferTrackerUpdatingItem(p));
}
}
}
void MarkCompactCollector::UpdatePointersAfterEvacuation() {
TRACE_GC(heap()->tracer(), GCTracer::Scope::MC_EVACUATE_UPDATE_POINTERS);
......@@ -4520,9 +4477,6 @@ void MarkCompactCollector::UpdatePointersAfterEvacuation() {
ItemParallelJob updating_job(isolate()->cancelable_task_manager(),
&page_parallel_job_semaphore_);
CollectNewSpaceArrayBufferTrackerItems(&updating_job);
CollectOldSpaceArrayBufferTrackerItems(&updating_job);
const int to_space_tasks = CollectToSpaceUpdatingItems(&updating_job);
const int remembered_set_tasks = CollectRememberedSetUpdatingItems(
&updating_job, RememberedSetUpdatingMode::ALL);
......@@ -4562,7 +4516,6 @@ void MinorMarkCompactCollector::UpdatePointersAfterEvacuation() {
ItemParallelJob updating_job(isolate()->cancelable_task_manager(),
&page_parallel_job_semaphore_);
CollectNewSpaceArrayBufferTrackerItems(&updating_job);
// Create batches of global handles.
SeedGlobalHandles<GlobalHandlesUpdatingItem>(isolate()->global_handles(),
&updating_job);
......
......@@ -369,8 +369,6 @@ class MinorMarkCompactCollector final : public MarkCompactCollectorBase {
void EvacuatePagesInParallel() override;
void UpdatePointersAfterEvacuation() override;
void CollectNewSpaceArrayBufferTrackerItems(ItemParallelJob* job);
int NumberOfParallelMarkingTasks(int pages);
Worklist* worklist_;
......@@ -747,9 +745,6 @@ class MarkCompactCollector final : public MarkCompactCollectorBase {
void EvacuatePagesInParallel() override;
void UpdatePointersAfterEvacuation() override;
void CollectNewSpaceArrayBufferTrackerItems(ItemParallelJob* job);
void CollectOldSpaceArrayBufferTrackerItems(ItemParallelJob* job);
void ReleaseEvacuationCandidates();
void PostProcessEvacuationCandidates();
void ReportAbortedEvacuationCandidate(HeapObject* failed_object, Page* page);
......
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