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

Unified Diff: src/spaces.cc

Issue 7712026: Clear mark bits while sweeping and not explicitly. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/gc
Patch Set: Correctly handle incremental marking as well. Created 9 years, 4 months 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/mark-compact.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index ae5f414eaccaa7bce127b05c9535db4eb7708b74..fa3fedfdc88b67ff3ffaeb3f2bed034fb24d53dc 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -1930,26 +1930,31 @@ void PagedSpace::PrepareForMarkCompact() {
Free(top(), old_linear_size);
SetTop(NULL, NULL);
- // Stop lazy sweeping for the space.
- if (FLAG_trace_gc && first_unswept_page_ != NULL) {
+ // Stop lazy sweeping and clear marking bits for the space.
+ if (first_unswept_page_ != NULL) {
int pages = 0;
- Page* p = last_unswept_page_;
+ Page* last = last_unswept_page_->next_page();
+ Page* p = first_unswept_page_;
do {
pages++;
+ Bitmap::Clear(p);
p = p->next_page();
- } while (p != last_unswept_page_);
- PrintF("Abandoned %d unswept pages\n", pages);
+ } while (p != last);
+ if (FLAG_trace_gc) {
+ PrintF("Abandoned %d unswept pages\n", pages);
+ }
}
first_unswept_page_ = last_unswept_page_ = Page::FromAddress(NULL);
// Clear the free list before a full GC---it will be rebuilt afterward.
free_list_.Reset();
- // Clear EVACUATED flag from all pages.
+ // Clear WAS_SWEPT and WAS_SWEPT_CONSERVATIVELY flags from all pages.
PageIterator it(this);
while (it.has_next()) {
Page* page = it.next();
page->ClearSwept();
+ page->ClearFlag(MemoryChunk::WAS_SWEPT_CONSERVATIVELY);
}
}
« no previous file with comments | « src/mark-compact.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698