Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index 705fdd10a415de7d1d10f29cab803714351f0da4..bc55f9e1c5f8fb88a9a3db623d2dba0efd3bc2d9 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -495,11 +495,11 @@ |
} |
-void Heap::RepairFreeListsAfterDeserialization() { |
+void Heap::RepairFreeListsAfterBoot() { |
PagedSpaces spaces(this); |
for (PagedSpace* space = spaces.next(); space != NULL; |
space = spaces.next()) { |
- space->RepairFreeListsAfterDeserialization(); |
+ space->RepairFreeListsAfterBoot(); |
} |
} |
@@ -952,15 +952,14 @@ |
} else { |
allocation = paged_space(space)->AllocateRaw(size); |
} |
- HeapObject* free_space; |
- if (allocation.To(&free_space)) { |
+ FreeListNode* node; |
+ if (allocation.To(&node)) { |
// Mark with a free list node, in case we have a GC before |
// deserializing. |
- Address free_space_address = free_space->address(); |
- CreateFillerObjectAt(free_space_address, size); |
+ node->set_size(this, size); |
DCHECK(space < Serializer::kNumberOfPreallocatedSpaces); |
- chunk.start = free_space_address; |
- chunk.end = free_space_address + size; |
+ chunk.start = node->address(); |
+ chunk.end = node->address() + size; |
} else { |
perform_gc = true; |
break; |
@@ -3393,17 +3392,12 @@ |
void Heap::CreateFillerObjectAt(Address addr, int size) { |
if (size == 0) return; |
HeapObject* filler = HeapObject::FromAddress(addr); |
- // At this point, we may be deserializing the heap from a snapshot, and |
- // none of the maps have been created yet and are NULL. |
if (size == kPointerSize) { |
- filler->set_map_no_write_barrier(raw_unchecked_one_pointer_filler_map()); |
- DCHECK(filler->map() == NULL || filler->map() == one_pointer_filler_map()); |
+ filler->set_map_no_write_barrier(one_pointer_filler_map()); |
} else if (size == 2 * kPointerSize) { |
- filler->set_map_no_write_barrier(raw_unchecked_two_pointer_filler_map()); |
- DCHECK(filler->map() == NULL || filler->map() == two_pointer_filler_map()); |
+ filler->set_map_no_write_barrier(two_pointer_filler_map()); |
} else { |
- filler->set_map_no_write_barrier(raw_unchecked_free_space_map()); |
- DCHECK(filler->map() == NULL || filler->map() == free_space_map()); |
+ filler->set_map_no_write_barrier(free_space_map()); |
FreeSpace::cast(filler)->set_size(size); |
} |
} |