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

Unified Diff: src/snapshot/snapshot-common.cc

Issue 2013713003: [heap] Switch to 500k pages (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix ReleaseOverReservedPages for no snapshot builds Created 4 years, 4 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
Index: src/snapshot/snapshot-common.cc
diff --git a/src/snapshot/snapshot-common.cc b/src/snapshot/snapshot-common.cc
index fed45d16b6c3528d241284765bbeb8631c489617..7af14b78b98acebb248c856a90fa3cb8366c59a6 100644
--- a/src/snapshot/snapshot-common.cc
+++ b/src/snapshot/snapshot-common.cc
@@ -31,11 +31,10 @@ bool Snapshot::HasContextSnapshot(Isolate* isolate, size_t index) {
return index < num_contexts;
}
-
-uint32_t Snapshot::SizeOfFirstPage(Isolate* isolate, AllocationSpace space) {
+uint32_t Snapshot::SizeOfSnapshot(Isolate* isolate, AllocationSpace space) {
DCHECK(space >= FIRST_PAGED_SPACE && space <= LAST_PAGED_SPACE);
if (!isolate->snapshot_available()) {
- return static_cast<uint32_t>(MemoryAllocator::PageAreaSize(space));
+ return 0;
}
uint32_t size;
int offset = kFirstPageSizesOffset + (space - FIRST_PAGED_SPACE) * kInt32Size;
@@ -146,11 +145,11 @@ void CalculateFirstPageSizes(const SnapshotData* startup_snapshot,
Page::kObjectStartOffset;
// Add a small allowance to the code space for small scripts.
if (space == CODE_SPACE) required += 32 * KB;
+ // And some allowance for regular objects.
+ if (space == OLD_SPACE) required += 4 * KB;
if (space >= FIRST_PAGED_SPACE && space <= LAST_PAGED_SPACE) {
- uint32_t max_size =
- MemoryAllocator::PageAreaSize(static_cast<AllocationSpace>(space));
- sizes_out[space - FIRST_PAGED_SPACE] = std::min(required, max_size);
+ sizes_out[space - FIRST_PAGED_SPACE] = required;
}
}
}
« src/heap/spaces.cc ('K') | « src/snapshot/snapshot.h ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698