Index: src/mark-compact.cc |
diff --git a/src/mark-compact.cc b/src/mark-compact.cc |
index 638968506d1c7d159c44bef46fd03a34b0aa8808..09b3417a289ffd0296777922433cde318d44509f 100644 |
--- a/src/mark-compact.cc |
+++ b/src/mark-compact.cc |
@@ -1929,7 +1929,8 @@ static void DiscoverGreyObjectsWithIterator(Heap* heap, |
static inline int MarkWordToObjectStarts(uint32_t mark_bits, int* starts); |
-static void DiscoverGreyObjectsOnPage(MarkingDeque* marking_deque, Page* p) { |
+static void DiscoverGreyObjectsOnPage(MarkingDeque* marking_deque, |
+ MemoryChunk* p) { |
ASSERT(!marking_deque->IsFull()); |
ASSERT(strcmp(Marking::kWhiteBitPattern, "00") == 0); |
ASSERT(strcmp(Marking::kBlackBitPattern, "10") == 0); |
@@ -2003,6 +2004,18 @@ static void DiscoverGreyObjectsInSpace(Heap* heap, |
} |
+static void DiscoverGreyObjectsInNewSpace(Heap* heap, |
+ MarkingDeque* marking_deque) { |
+ NewSpace* space = heap->new_space(); |
+ NewSpacePageIterator it(space->bottom(), space->top()); |
+ while (it.has_next()) { |
+ NewSpacePage* page = it.next(); |
+ DiscoverGreyObjectsOnPage(marking_deque, page); |
+ if (marking_deque->IsFull()) return; |
+ } |
+} |
+ |
+ |
bool MarkCompactCollector::IsUnmarkedHeapObject(Object** p) { |
Object* o = *p; |
if (!o->IsHeapObject()) return false; |
@@ -2109,8 +2122,7 @@ void MarkCompactCollector::EmptyMarkingDeque() { |
void MarkCompactCollector::RefillMarkingDeque() { |
ASSERT(marking_deque_.overflowed()); |
- SemiSpaceIterator new_it(heap()->new_space()); |
- DiscoverGreyObjectsWithIterator(heap(), &marking_deque_, &new_it); |
+ DiscoverGreyObjectsInNewSpace(heap(), &marking_deque_); |
if (marking_deque_.IsFull()) return; |
DiscoverGreyObjectsInSpace(heap(), |