Index: src/mark-compact.cc |
diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
index acd36a938e4489f6f5d91bf0ea88fe6c84e11077..7646fcaf121389cc57ffb13a3bd35febe94eedee 100644 |
--- a/src/mark-compact.cc |
+++ b/src/mark-compact.cc |
@@ -1889,6 +1889,14 @@ class MarkCompactWeakObjectRetainer : public WeakObjectRetainer { |
virtual Object* RetainAs(Object* object) { |
if (Marking::MarkBitFrom(HeapObject::cast(object)).Get()) { |
return object; |
+ } else if (object->IsAllocationSite() && |
+ !(AllocationSite::cast(object)->IsZombie())) { |
+ // "dead" AllocationSites need to live long enough for a traversal of new |
+ // space. These sites get a one-time reprieve. |
+ AllocationSite* site = AllocationSite::cast(object); |
+ site->MarkZombie(); |
+ site->GetHeap()->mark_compact_collector()->MarkAllocationSite(site); |
+ return object; |
} else { |
return NULL; |
} |
@@ -2000,12 +2008,7 @@ int MarkCompactCollector::DiscoverAndPromoteBlackObjectsOnPage( |
int size = object->Size(); |
survivors_size += size; |
- if (FLAG_trace_track_allocation_sites && object->IsJSObject()) { |
- if (AllocationMemento::FindForJSObject(JSObject::cast(object), true) |
- != NULL) { |
- heap()->allocation_mementos_found_++; |
- } |
- } |
+ Heap::AddressMemento(object); |
offset++; |
current_cell >>= 1; |
@@ -2098,6 +2101,12 @@ void MarkCompactCollector::MarkStringTable(RootMarkingVisitor* visitor) { |
} |
+void MarkCompactCollector::MarkAllocationSite(AllocationSite* site) { |
+ MarkBit mark_bit = Marking::MarkBitFrom(site); |
+ SetMark(site, mark_bit); |
+} |
+ |
+ |
void MarkCompactCollector::MarkRoots(RootMarkingVisitor* visitor) { |
// Mark the heap roots including global variables, stack variables, |
// etc., and all objects reachable from them. |