Commit d2be8de9 authored by Dominik Inführ's avatar Dominik Inführ Committed by V8 LUCI CQ

[heap] Assume COMPACTION_WAS_ABORTED page flags in ReRecordPage

Set COMPACTION_WAS_ABORTED page flag also when aborting evacuation
due to OOM.

Bug: chromium:1359294, v8:12578
Change-Id: Ia9833dbf9213375698cb7b1595ade7df5e24189d
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3877145Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/main@{#83047}
parent 0b670eef
...@@ -4531,9 +4531,6 @@ void MarkCompactCollector::EvacuatePagesInParallel() { ...@@ -4531,9 +4531,6 @@ void MarkCompactCollector::EvacuatePagesInParallel() {
if (!v8_flags.compact_with_stack || if (!v8_flags.compact_with_stack ||
page->owner_identity() == CODE_SPACE) { page->owner_identity() == CODE_SPACE) {
ReportAbortedEvacuationCandidateDueToFlags(page->area_start(), page); ReportAbortedEvacuationCandidateDueToFlags(page->area_start(), page);
// Set this flag early on in this case to allow filtering such pages
// below.
page->SetFlag(Page::COMPACTION_WAS_ABORTED);
} }
} }
} }
...@@ -4549,9 +4546,6 @@ void MarkCompactCollector::EvacuatePagesInParallel() { ...@@ -4549,9 +4546,6 @@ void MarkCompactCollector::EvacuatePagesInParallel() {
if (isolate()->fuzzer_rng()->NextDouble() < kFraction) { if (isolate()->fuzzer_rng()->NextDouble() < kFraction) {
ReportAbortedEvacuationCandidateDueToFlags(page->area_start(), page); ReportAbortedEvacuationCandidateDueToFlags(page->area_start(), page);
// Set this flag early on in this case to allow filtering such pages
// below.
page->SetFlag(Page::COMPACTION_WAS_ABORTED);
} }
} }
} }
...@@ -5401,6 +5395,8 @@ void MarkCompactCollector::UpdatePointersInClientHeap(Isolate* client) { ...@@ -5401,6 +5395,8 @@ void MarkCompactCollector::UpdatePointersInClientHeap(Isolate* client) {
void MarkCompactCollector::ReportAbortedEvacuationCandidateDueToOOM( void MarkCompactCollector::ReportAbortedEvacuationCandidateDueToOOM(
Address failed_start, Page* page) { Address failed_start, Page* page) {
DCHECK(!page->IsFlagSet(Page::COMPACTION_WAS_ABORTED));
page->SetFlag(Page::COMPACTION_WAS_ABORTED);
base::MutexGuard guard(&mutex_); base::MutexGuard guard(&mutex_);
aborted_evacuation_candidates_due_to_oom_.push_back( aborted_evacuation_candidates_due_to_oom_.push_back(
std::make_pair(failed_start, page)); std::make_pair(failed_start, page));
...@@ -5408,6 +5404,8 @@ void MarkCompactCollector::ReportAbortedEvacuationCandidateDueToOOM( ...@@ -5408,6 +5404,8 @@ void MarkCompactCollector::ReportAbortedEvacuationCandidateDueToOOM(
void MarkCompactCollector::ReportAbortedEvacuationCandidateDueToFlags( void MarkCompactCollector::ReportAbortedEvacuationCandidateDueToFlags(
Address failed_start, Page* page) { Address failed_start, Page* page) {
DCHECK(!page->IsFlagSet(Page::COMPACTION_WAS_ABORTED));
page->SetFlag(Page::COMPACTION_WAS_ABORTED);
base::MutexGuard guard(&mutex_); base::MutexGuard guard(&mutex_);
aborted_evacuation_candidates_due_to_flags_.push_back( aborted_evacuation_candidates_due_to_flags_.push_back(
std::make_pair(failed_start, page)); std::make_pair(failed_start, page));
...@@ -5418,7 +5416,8 @@ namespace { ...@@ -5418,7 +5416,8 @@ namespace {
void ReRecordPage(Heap* heap, void ReRecordPage(Heap* heap,
v8::internal::NonAtomicMarkingState* marking_state, v8::internal::NonAtomicMarkingState* marking_state,
Address failed_start, Page* page) { Address failed_start, Page* page) {
page->SetFlag(Page::COMPACTION_WAS_ABORTED); DCHECK(page->IsFlagSet(Page::COMPACTION_WAS_ABORTED));
// Aborted compaction page. We have to record slots here, since we // Aborted compaction page. We have to record slots here, since we
// might not have recorded them in first place. // might not have recorded them in first place.
......
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