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);
}
+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;
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(),