Skip to content
This repository has been archived by the owner on Apr 3, 2020. It is now read-only.

Commit

Permalink
Revert of Track how many pages trigger fallback strategies in GC (pat…
Browse files Browse the repository at this point in the history
…chset #2 id:20001 of https://codereview.chromium.org/1029323003/)

Reason for revert:
This seems to cause lots of crashes in layout tests debug:
../../third_party/WebKit/Source/bindings/core/v8/V8PerIsolateData.cpp(67) : void blink::useCounterCallback(v8::Isolate *, v8::Isolate::UseCounte

http://build.chromium.org/p/client.v8/builders/V8-Blink%20Linux%2064%20%28dbg%29/builds/2332

Original issue's description:
> Track how many pages trigger fallback strategies in GC
>
> [email protected]
> BUG=
>
> Committed: https://crrev.com/bb880058f6499510cff12d98dc7d524d35d769cb
> Cr-Commit-Position: refs/heads/master@{#27421}

[email protected],[email protected]
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=

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

Cr-Commit-Position: refs/heads/master@{#27427}
  • Loading branch information
mi-ac authored and Commit bot committed Mar 24, 2015
1 parent 4629f80 commit 96cfadd
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 32 deletions.
5 changes: 1 addition & 4 deletions include/v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -5073,17 +5073,14 @@ class V8_EXPORT Isolate {
};

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

Expand Down
25 changes: 0 additions & 25 deletions src/heap/mark-compact.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2041,7 +2041,6 @@ 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_);
Expand Down Expand Up @@ -4530,30 +4529,6 @@ 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() &&
Expand Down
22 changes: 21 additions & 1 deletion src/heap/mark-compact.h
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,27 @@ 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);
Expand Down Expand Up @@ -673,7 +694,6 @@ class MarkCompactCollector {
bool WillBeDeoptimized(Code* code);
void RemoveDeadInvalidatedCode();
void ProcessInvalidatedCode(ObjectVisitor* visitor);
void EvictEvacuationCandidate(Page* page);

void StartSweeperThreads();

Expand Down
2 changes: 0 additions & 2 deletions src/heap/store-buffer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,6 @@ 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;
}
Expand Down

0 comments on commit 96cfadd

Please sign in to comment.