| Index: src/spaces.cc
|
| ===================================================================
|
| --- src/spaces.cc (revision 7374)
|
| +++ src/spaces.cc (working copy)
|
| @@ -74,7 +74,13 @@
|
|
|
| HeapObjectIterator::HeapObjectIterator(Page* page,
|
| HeapObjectCallback size_func) {
|
| - Initialize(page->owner(),
|
| + Space* owner = page->owner();
|
| + ASSERT(owner == Heap::old_pointer_space() ||
|
| + owner == Heap::old_data_space() ||
|
| + owner == Heap::map_space() ||
|
| + owner == Heap::cell_space() ||
|
| + owner == Heap::code_space());
|
| + Initialize(reinterpret_cast<PagedSpace*>(owner),
|
| page->ObjectAreaStart(),
|
| page->ObjectAreaEnd(),
|
| kOnePageOnly,
|
| @@ -388,7 +394,7 @@
|
|
|
|
|
| void Page::InitializeAsAnchor(PagedSpace* owner) {
|
| - owner_ = owner;
|
| + set_owner(owner);
|
| set_prev_page(this);
|
| set_next_page(this);
|
| }
|
| @@ -404,8 +410,9 @@
|
|
|
| chunk->size_ = size;
|
| chunk->flags_ = 0;
|
| - chunk->owner_ = owner;
|
| + chunk->set_owner(owner);
|
| chunk->markbits()->Clear();
|
| + chunk->set_scan_on_scavenge(false);
|
|
|
| if (executable == EXECUTABLE) chunk->SetFlag(IS_EXECUTABLE);
|
|
|
| @@ -1425,9 +1432,6 @@
|
|
|
|
|
| int OldSpaceFreeList::Free(Address start, int size_in_bytes) {
|
| -#ifdef DEBUG
|
| - MemoryAllocator::ZapBlock(start, size_in_bytes);
|
| -#endif
|
| if (size_in_bytes == 0) return 0;
|
| FreeListNode* node = FreeListNode::FromAddress(start);
|
| node->set_size(size_in_bytes);
|
| @@ -1587,6 +1591,13 @@
|
|
|
| void PagedSpace::PrepareForMarkCompact(bool will_compact) {
|
| ASSERT(!will_compact);
|
| + // We don't have a linear allocation area while sweeping. It will be restored
|
| + // on the first allocation after the sweep.
|
| + // Mark the old linear allocation area with a free space map so it can be
|
| + // skipped when scanning the heap.
|
| + int old_linear_size = limit() - top();
|
| + Free(top(), old_linear_size);
|
| + SetTop(NULL, NULL);
|
| }
|
|
|
|
|
| @@ -1780,6 +1791,7 @@
|
| ", available: %" V8_PTR_PREFIX "d, %%%d\n",
|
| Capacity(), Waste(), Available(), pct);
|
|
|
| + if (was_swept_conservatively_) return;
|
| ClearHistograms();
|
| HeapObjectIterator obj_it(this);
|
| for (HeapObject* obj = obj_it.Next(); obj != NULL; obj = obj_it.Next())
|
|
|