Do not iterate the new space on marking deque overflow.

BUG=
R=mstarzinger@chromium.org

Review URL: https://codereview.chromium.org/18238008

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15567 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
This commit is contained in:
hpayer@chromium.org 2013-07-09 08:40:34 +00:00
parent a9fd01d567
commit 42c82d5e4f

View File

@ -1931,7 +1931,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);
@ -2005,6 +2006,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;
@ -2111,8 +2124,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(),