Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Unified Diff: src/heap/mark-compact.cc

Issue 1037433002: Avoid evacuation of popular pages. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Rebase Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/mark-compact.h ('k') | src/heap/mark-compact-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index a924d8dc08ef69567c64747b9ceb5b11b475fbe4..7a284ae9855a7177be732d380a42b428b6f459bc 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -774,6 +774,11 @@ void MarkCompactCollector::CollectEvacuationCandidates(PagedSpace* space) {
while (it.has_next()) {
Page* p = it.next();
if (p->NeverEvacuate()) continue;
+ if (p->IsFlagSet(Page::POPULAR_PAGE)) {
+ // This page had slots buffer overflow on previous GC, skip it.
+ p->ClearFlag(Page::POPULAR_PAGE);
+ continue;
+ }
// Invariant: Evacuation candidates are just created when marking is
// started. At the end of a GC all evacuation candidates are cleared and
@@ -4617,13 +4622,13 @@ void MarkCompactCollector::RecordRelocSlot(RelocInfo* rinfo, Object* target) {
SlotTypeForRMode(rmode), rinfo->pc(), SlotsBuffer::FAIL_ON_OVERFLOW);
}
if (!success) {
- EvictEvacuationCandidate(target_page);
+ EvictPopularEvacuationCandidate(target_page);
}
}
}
-void MarkCompactCollector::EvictEvacuationCandidate(Page* page) {
+void MarkCompactCollector::EvictPopularEvacuationCandidate(Page* page) {
if (FLAG_trace_fragmentation) {
PrintF("Page %p is too popular. Disabling evacuation.\n",
reinterpret_cast<void*>(page));
@@ -4635,6 +4640,9 @@ void MarkCompactCollector::EvictEvacuationCandidate(Page* page) {
// should stop slots recording entirely.
page->ClearEvacuationCandidate();
+ DCHECK(!page->IsFlagSet(Page::POPULAR_PAGE));
+ page->SetFlag(Page::POPULAR_PAGE);
+
// We were not collecting slots on this page that point
// to other evacuation candidates thus we have to
// rescan the page after evacuation to discover and update all
@@ -4651,7 +4659,7 @@ void MarkCompactCollector::RecordCodeEntrySlot(Address slot, Code* target) {
target_page->slots_buffer_address(),
SlotsBuffer::CODE_ENTRY_SLOT, slot,
SlotsBuffer::FAIL_ON_OVERFLOW)) {
- EvictEvacuationCandidate(target_page);
+ EvictPopularEvacuationCandidate(target_page);
}
}
}
« no previous file with comments | « src/heap/mark-compact.h ('k') | src/heap/mark-compact-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698