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

Unified Diff: src/mark-compact.cc

Issue 40063002: Bookkeeping for allocation site pretenuring (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebase built on site fields in another CL. Created 7 years, 1 month 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
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.

Powered by Google App Engine
This is Rietveld 408576698