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

Unified Diff: src/mark-compact.cc

Issue 9179012: Reduce boot-up memory use of V8. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: Created 8 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/incremental-marking.cc ('k') | src/platform.h » ('j') | src/spaces.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/mark-compact.cc
===================================================================
--- src/mark-compact.cc (revision 10407)
+++ src/mark-compact.cc (working copy)
@@ -2887,7 +2887,8 @@
for ( ; live_objects != 0; live_objects--) {
Address free_end = object_address + offsets[live_index++] * kPointerSize;
if (free_end != free_start) {
- space->Free(free_start, static_cast<int>(free_end - free_start));
+ space->AddToFreeLists(free_start,
+ static_cast<int>(free_end - free_start));
}
HeapObject* live_object = HeapObject::FromAddress(free_end);
ASSERT(Marking::IsBlack(Marking::MarkBitFrom(live_object)));
@@ -2913,7 +2914,8 @@
cells[cell_index] = 0;
}
if (free_start != p->ObjectAreaEnd()) {
- space->Free(free_start, static_cast<int>(p->ObjectAreaEnd() - free_start));
+ space->AddToFreeLists(free_start,
+ static_cast<int>(p->ObjectAreaEnd() - free_start));
}
p->ResetLiveBytes();
}
@@ -3206,7 +3208,8 @@
Page* p = evacuation_candidates_[i];
if (!p->IsEvacuationCandidate()) continue;
PagedSpace* space = static_cast<PagedSpace*>(p->owner());
- space->Free(p->ObjectAreaStart(), Page::kObjectAreaSize);
+ space->AddToFreeLists(p->ObjectAreaStart(),
+ p->ObjectAreaEnd() - p->ObjectAreaStart());
p->set_scan_on_scavenge(false);
slots_buffer_allocator_.DeallocateChain(p->slots_buffer_address());
p->ClearEvacuationCandidate();
@@ -3523,8 +3526,8 @@
}
size_t size = block_address - p->ObjectAreaStart();
if (cell_index == last_cell_index) {
- freed_bytes += static_cast<int>(space->Free(p->ObjectAreaStart(),
- static_cast<int>(size)));
+ freed_bytes += static_cast<int>(space->AddToFreeLists(
+ p->ObjectAreaStart(), static_cast<int>(size)));
ASSERT_EQ(0, p->LiveBytes());
return freed_bytes;
}
@@ -3533,8 +3536,8 @@
Address free_end = StartOfLiveObject(block_address, cells[cell_index]);
// Free the first free space.
size = free_end - p->ObjectAreaStart();
- freed_bytes += space->Free(p->ObjectAreaStart(),
- static_cast<int>(size));
+ freed_bytes += space->AddToFreeLists(p->ObjectAreaStart(),
+ static_cast<int>(size));
// The start of the current free area is represented in undigested form by
// the address of the last 32-word section that contained a live object and
// the marking bitmap for that cell, which describes where the live object
@@ -3563,8 +3566,8 @@
// so now we need to find the start of the first live object at the
// end of the free space.
free_end = StartOfLiveObject(block_address, cell);
- freed_bytes += space->Free(free_start,
- static_cast<int>(free_end - free_start));
+ freed_bytes += space->AddToFreeLists(
+ free_start, static_cast<int>(free_end - free_start));
}
}
// Update our undigested record of where the current free area started.
@@ -3578,8 +3581,8 @@
// Handle the free space at the end of the page.
if (block_address - free_start > 32 * kPointerSize) {
free_start = DigestFreeStart(free_start, free_start_cell);
- freed_bytes += space->Free(free_start,
- static_cast<int>(block_address - free_start));
+ freed_bytes += space->AddToFreeLists(
+ free_start, static_cast<int>(block_address - free_start));
}
p->ResetLiveBytes();
« no previous file with comments | « src/incremental-marking.cc ('k') | src/platform.h » ('j') | src/spaces.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698