Reviewers: jarin, rmcilroy,

Description:
Precisely sweep scan on scavenge pages and use heap iterator to iterate over
them.

BUG=

Please review this at https://codereview.chromium.org/362313002/

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

Affected files (+31, -7 lines):
  M src/mark-compact.cc
  M src/store-buffer.cc


Index: src/mark-compact.cc
diff --git a/src/mark-compact.cc b/src/mark-compact.cc
index 8846f19bb0dbaeec80192bf9709b3e3f1029cf2c..5ad18a6b3c6a6ea6ee23a1e81e886afa48a4999f 100644
--- a/src/mark-compact.cc
+++ b/src/mark-compact.cc
@@ -4145,12 +4145,23 @@ void MarkCompactCollector::SweepSpace(PagedSpace* space, SweeperType sweeper) {
           pages_swept++;
           parallel_sweeping_active = true;
         } else {
-          if (FLAG_gc_verbose) {
- PrintF("Sweeping 0x%" V8PRIxPTR " conservatively in parallel.\n",
-                   reinterpret_cast<intptr_t>(p));
+          if (p->scan_on_scavenge()) {
+ SweepPrecisely<SWEEP_ONLY, IGNORE_SKIP_LIST, IGNORE_FREE_SPACE>(
+                space, p, NULL);
+            pages_swept++;
+            if (FLAG_gc_verbose) {
+              PrintF("Sweeping 0x%" V8PRIxPTR
+                  " scan on scavenge page precisely.\n",
+                  reinterpret_cast<intptr_t>(p));
+            }
+          } else {
+            if (FLAG_gc_verbose) {
+ PrintF("Sweeping 0x%" V8PRIxPTR " conservatively in parallel.\n",
+                  reinterpret_cast<intptr_t>(p));
+            }
+ p->set_parallel_sweeping(MemoryChunk::PARALLEL_SWEEPING_PENDING);
+            space->IncreaseUnsweptFreeBytes(p);
           }
-          p->set_parallel_sweeping(MemoryChunk::PARALLEL_SWEEPING_PENDING);
-          space->IncreaseUnsweptFreeBytes(p);
         }
         space->set_end_of_unswept_pages(p);
         break;
Index: src/store-buffer.cc
diff --git a/src/store-buffer.cc b/src/store-buffer.cc
index 4ab5c33c8cc439b59033c85c4be1ae5b92c67d49..e4cef27b4a5433d71e934425247767216aebbb02 100644
--- a/src/store-buffer.cc
+++ b/src/store-buffer.cc
@@ -552,8 +552,21 @@ void StoreBuffer::IteratePointersToNewSpace(ObjectSlotCallback slot_callback,
             FindPointersToNewSpaceInMapsRegion(
                 start, end, slot_callback, clear_maps);
           } else {
-            FindPointersToNewSpaceInRegion(
-                start, end, slot_callback, clear_maps);
+            ASSERT(page->WasSweptPrecisely());
+            HeapObjectIterator iterator(page, NULL);
+            for (HeapObject* heap_object = iterator.Next();
+                 heap_object != NULL;
+                 heap_object = iterator.Next()) {
+              // We skip filler, free space, and constant pool objects.
+              if (!heap_object->IsFiller() &&
+                  !heap_object->IsConstantPoolArray()) {
+                FindPointersToNewSpaceInRegion(
+                    heap_object->address() + HeapObject::kHeaderSize,
+                    heap_object->address() + heap_object->Size(),
+                    slot_callback,
+                    clear_maps);
+              }
+            }
           }
         }
       }


--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to