| Index: src/spaces.cc
|
| diff --git a/src/spaces.cc b/src/spaces.cc
|
| index 739154ca55c23474685ad77457b336df08d1e774..e61e7127aa8cee04570f65011b7174893f3a0f03 100644
|
| --- a/src/spaces.cc
|
| +++ b/src/spaces.cc
|
| @@ -1773,7 +1773,23 @@ HeapObject* OldSpace::SlowAllocateRaw(int size_in_bytes) {
|
| // and allocated object address.
|
| // Memory above the allocation watermark was not swept and
|
| // might contain garbage pointers to new space.
|
| - ASSERT(obj->address() == p->AllocationWatermark());
|
| + if (obj->address() != p->AllocationWatermark()) {
|
| + // TODO(gc) this is waste of time. we should enable linear allocation
|
| + // at least from above watermark
|
| + HeapObject* filler =
|
| + HeapObject::FromAddress(p->AllocationWatermark());
|
| + while (filler->address() < obj->address()) {
|
| + Address next_filler = filler->address() + filler->Size();
|
| + if (filler->Size() > ByteArray::kHeaderSize) {
|
| + for (Address slot = filler->address() + ByteArray::kHeaderSize;
|
| + slot < next_filler;
|
| + slot += kPointerSize) {
|
| + Memory::Address_at(slot) = 0;
|
| + }
|
| + }
|
| + filler = HeapObject::FromAddress(next_filler);
|
| + }
|
| + }
|
| p->SetAllocationWatermark(obj->address() + size_in_bytes);
|
| }
|
|
|
| @@ -1803,10 +1819,7 @@ void OldSpace::PutRestOfCurrentPageOnFreeList(Page* current_page) {
|
| current_page->SetAllocationWatermark(allocation_info_.top);
|
| int free_size =
|
| static_cast<int>(current_page->ObjectAreaEnd() - allocation_info_.top);
|
| - if (free_size > 0) {
|
| - int wasted_bytes = free_list_.Free(allocation_info_.top, free_size);
|
| - accounting_stats_.WasteBytes(wasted_bytes);
|
| - }
|
| + if (free_size > 0) AddToFreeList(allocation_info_.top, free_size);
|
| }
|
|
|
|
|
|
|