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

Unified Diff: src/spaces.cc

Issue 8692002: Only sweep one page eagerly unless we are running out of space. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 9 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
« no previous file with comments | « src/spaces.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.cc
===================================================================
--- src/spaces.cc (revision 10059)
+++ src/spaces.cc (working copy)
@@ -738,7 +738,6 @@
}
-#ifdef DEBUG
int PagedSpace::CountTotalPages() {
PageIterator it(this);
int count = 0;
@@ -748,7 +747,6 @@
}
return count;
}
-#endif
void PagedSpace::ReleasePage(Page* page) {
@@ -1853,6 +1851,13 @@
// skipped when scanning the heap. This also puts it back in the free list
// if it is big enough.
owner_->Free(owner_->top(), old_linear_size);
+
+#ifdef DEBUG
+ for (int i = 0; i < size_in_bytes / kPointerSize; i++) {
+ reinterpret_cast<Object**>(new_node)[i] = Smi::FromInt(0);
+ }
+#endif
+
owner_->heap()->incremental_marking()->OldSpaceStep(
size_in_bytes - old_linear_size);
@@ -2443,8 +2448,17 @@
page->set_next_page(first_page_);
first_page_ = page;
+ HeapObject* object = page->GetObject();
+
+#ifdef DEBUG
+ // Make the object consistent so the heap can be vefified in OldSpaceStep.
+ reinterpret_cast<Object**>(object->address())[0] =
+ heap()->fixed_array_map();
+ reinterpret_cast<Object**>(object->address())[1] = Smi::FromInt(0);
+#endif
+
heap()->incremental_marking()->OldSpaceStep(object_size);
- return page->GetObject();
+ return object;
}
« no previous file with comments | « src/spaces.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698