Index: src/heap/mark-compact.h |
diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h |
index 9e2730a205ac4328d8f6f68818abe173d4ab699c..ddb993f5a2f676491e732da2a1a39cae26c48b59 100644 |
--- a/src/heap/mark-compact.h |
+++ b/src/heap/mark-compact.h |
@@ -589,6 +589,27 @@ |
->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); |
@@ -673,7 +694,6 @@ |
bool WillBeDeoptimized(Code* code); |
void RemoveDeadInvalidatedCode(); |
void ProcessInvalidatedCode(ObjectVisitor* visitor); |
- void EvictEvacuationCandidate(Page* page); |
void StartSweeperThreads(); |