Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Unified Diff: src/heap/heap.cc

Issue 882443004: Revert of Only use FreeSpace objects in the free list. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
}
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698