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

Unified Diff: src/heap/spaces.cc

Issue 1864953003: [heap] Unify LargePage, NewSpacePage, and Page allocation (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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/spaces.h ('k') | src/heap/spaces-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index 780a2d4926931bf2f88c9abe68f8ec8f147c4db1..0f50cdd0d35028a47fdb59d75a3a4c603267eeda 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -684,20 +684,6 @@ void Page::ResetFreeListStatistics() {
available_in_free_list_ = 0;
}
-LargePage* MemoryAllocator::AllocateLargePage(intptr_t object_size,
- Space* owner,
- Executability executable) {
- MemoryChunk* chunk =
- AllocateChunk(object_size, object_size, executable, owner);
- if (chunk == NULL) return NULL;
- if (executable && chunk->size() > LargePage::kMaxCodePageSize) {
- STATIC_ASSERT(LargePage::kMaxCodePageSize <= TypedSlotSet::kMaxOffset);
- FATAL("Code page is too large.");
- }
- return LargePage::Initialize(isolate_->heap(), chunk);
-}
-
-
void MemoryAllocator::PreFreeMemory(MemoryChunk* chunk) {
DCHECK(!chunk->IsFlagSet(MemoryChunk::PRE_FREED));
LOG(isolate_, DeleteEvent("MemoryChunk", chunk));
@@ -780,6 +766,10 @@ template Page* MemoryAllocator::AllocatePage<Page, MemoryAllocator::kRegular,
PagedSpace>(intptr_t, PagedSpace*,
Executability);
+template LargePage*
+MemoryAllocator::AllocatePage<LargePage, MemoryAllocator::kRegular, Space>(
+ intptr_t, Space*, Executability);
+
template NewSpacePage* MemoryAllocator::AllocatePage<
NewSpacePage, MemoryAllocator::kPooled, SemiSpace>(intptr_t, SemiSpace*,
Executability);
@@ -2886,8 +2876,9 @@ AllocationResult LargeObjectSpace::AllocateRaw(int object_size,
return AllocationResult::Retry(identity());
}
- LargePage* page = heap()->isolate()->memory_allocator()->AllocateLargePage(
- object_size, this, executable);
+ LargePage* page =
+ heap()->isolate()->memory_allocator()->AllocatePage<LargePage>(
+ object_size, this, executable);
if (page == NULL) return AllocationResult::Retry(identity());
DCHECK(page->area_size() >= object_size);
« no previous file with comments | « src/heap/spaces.h ('k') | src/heap/spaces-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698