Track how many pages trigger fallback strategies in GC

R=hpayer@chromium.org
BUG=

Review URL: https://codereview.chromium.org/1029323003

Cr-Commit-Position: refs/heads/master@{#27421}
This commit is contained in:
erikcorry 2015-03-24 09:17:42 -07:00 committed by Commit bot
parent a3b7c8320e
commit bb880058f6
4 changed files with 32 additions and 22 deletions

View File

@ -5073,7 +5073,7 @@ class V8_EXPORT Isolate {
};
/**
* Features reported via the SetUseCounterCallback callback. Do not chang
* Features reported via the SetUseCounterCallback callback. Do not change
* assigned numbers of existing items; add new features to the end of this
* list.
*/
@ -5081,6 +5081,9 @@ class V8_EXPORT Isolate {
kUseAsm = 0,
kBreakIterator = 1,
kLegacyConst = 2,
kMarkDequeOverflow = 3,
kStoreBufferOverflow = 4,
kSlotsBufferOverflow = 5,
kUseCounterFeatureCount // This enum value must be last.
};

View File

@ -2041,6 +2041,7 @@ void MarkCompactCollector::EmptyMarkingDeque() {
// overflowed objects in the heap so the overflow flag on the markings stack
// is cleared.
void MarkCompactCollector::RefillMarkingDeque() {
isolate()->CountUsage(v8::Isolate::UseCounterFeature::kMarkDequeOverflow);
DCHECK(marking_deque_.overflowed());
DiscoverGreyObjectsInNewSpace(heap(), &marking_deque_);
@ -4529,6 +4530,30 @@ void MarkCompactCollector::RecordRelocSlot(RelocInfo* rinfo, Object* target) {
}
void MarkCompactCollector::EvictEvacuationCandidate(Page* page) {
if (FLAG_trace_fragmentation) {
PrintF("Page %p is too popular. Disabling evacuation.\n",
reinterpret_cast<void*>(page));
}
isolate()->CountUsage(v8::Isolate::UseCounterFeature::kSlotsBufferOverflow);
// TODO(gc) If all evacuation candidates are too popular we
// should stop slots recording entirely.
page->ClearEvacuationCandidate();
// 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
// pointers to evacuated objects.
if (page->owner()->identity() == OLD_DATA_SPACE) {
evacuation_candidates_.RemoveElement(page);
} else {
page->SetFlag(Page::RESCAN_ON_EVACUATION);
}
}
void MarkCompactCollector::RecordCodeEntrySlot(Address slot, Code* target) {
Page* target_page = Page::FromAddress(reinterpret_cast<Address>(target));
if (target_page->IsEvacuationCandidate() &&

View File

@ -589,27 +589,6 @@ class MarkCompactCollector {
->IsEvacuationCandidate();
}
INLINE(void EvictEvacuationCandidate(Page* page)) {
if (FLAG_trace_fragmentation) {
PrintF("Page %p is too popular. Disabling evacuation.\n",
reinterpret_cast<void*>(page));
}
// TODO(gc) If all evacuation candidates are too popular we
// should stop slots recording entirely.
page->ClearEvacuationCandidate();
// 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
// pointers to evacuated objects.
if (page->owner()->identity() == OLD_DATA_SPACE) {
evacuation_candidates_.RemoveElement(page);
} else {
page->SetFlag(Page::RESCAN_ON_EVACUATION);
}
}
void RecordRelocSlot(RelocInfo* rinfo, Object* target);
void RecordCodeEntrySlot(Address slot, Code* target);
void RecordCodeTargetPatch(Address pc, Code* target);
@ -694,6 +673,7 @@ class MarkCompactCollector {
bool WillBeDeoptimized(Code* code);
void RemoveDeadInvalidatedCode();
void ProcessInvalidatedCode(ObjectVisitor* visitor);
void EvictEvacuationCandidate(Page* page);
void StartSweeperThreads();

View File

@ -197,6 +197,8 @@ void StoreBuffer::ExemptPopularPages(int prime_sample_step, int threshold) {
}
if (created_new_scan_on_scavenge_pages) {
Filter(MemoryChunk::SCAN_ON_SCAVENGE);
heap_->isolate()->CountUsage(
v8::Isolate::UseCounterFeature::kStoreBufferOverflow);
}
old_buffer_is_filtered_ = true;
}