Reviewers: Erik Corry,

Description:
Do not delay sweeping of pages that are completely free.

R=erik.co...@gmail.com


Please review this at http://codereview.chromium.org/8997004/

SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge

Affected files:
  M src/mark-compact.cc
  M src/spaces.cc


Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index a864c346740a8c05156ca809888f5a9959cb48a8..1fb5d5f438b152f23f6d1ea1ef53a8cd9cb3f26c 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -3623,14 +3623,6 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType sweeper) {
       continue;
     }

-    if (lazy_sweeping_active) {
-      if (FLAG_gc_verbose) {
-        PrintF("Sweeping 0x%" V8PRIxPTR " lazily postponed.\n",
-               reinterpret_cast<intptr_t>(p));
-      }
-      continue;
-    }
-
// One unused page is kept, all further are released before sweeping them.
     if (p->LiveBytes() == 0) {
       if (unused_page_present) {
@@ -3644,6 +3636,14 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType sweeper) {
       unused_page_present = true;
     }

+    if (lazy_sweeping_active) {
+      if (FLAG_gc_verbose) {
+        PrintF("Sweeping 0x%" V8PRIxPTR " lazily postponed.\n",
+               reinterpret_cast<intptr_t>(p));
+      }
+      continue;
+    }
+
     switch (sweeper) {
       case CONSERVATIVE: {
         if (FLAG_gc_verbose) {
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index a5712a0f5346d83adacf26250cda82894971e40b..d5e3658944c9a500c94c90ef9a2ee6577f9bae56 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -752,7 +752,7 @@ int PagedSpace::CountTotalPages() {
 void PagedSpace::ReleasePage(Page* page) {
   ASSERT(page->LiveBytes() == 0);

-  // Adjust list of unswept pages if the page is it's head or tail.
+  // Adjust list of unswept pages if the page is it's head.
   if (first_unswept_page_ == page) {
     first_unswept_page_ = page->next_page();
     if (first_unswept_page_ == anchor()) {


--
v8-dev mailing list
v8-dev@googlegroups.com
http://groups.google.com/group/v8-dev

Reply via email to