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

Unified Diff: src/heap/spaces.h

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 | « no previous file | src/heap/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index f181927ea0da82cf77c3e08d8b62f1c8dadd017f..d76d253b7052233d4e0232c51d34fdd9670e15e5 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -882,9 +882,6 @@ class Page : public MemoryChunk {
inline void ClearGCFields();
- static inline Page* Initialize(Heap* heap, MemoryChunk* chunk,
- Executability executable, PagedSpace* owner);
-
void InitializeAsAnchor(PagedSpace* owner);
// WaitUntilSweepingCompleted only works when concurrent sweeping is in
@@ -937,6 +934,9 @@ class Page : public MemoryChunk {
inline void ClearEvacuationCandidate();
private:
+ static inline Page* Initialize(Heap* heap, MemoryChunk* chunk,
+ Executability executable, PagedSpace* owner);
+
inline void InitializeFreeListCategories();
friend class MemoryAllocator;
@@ -960,7 +960,8 @@ class LargePage : public MemoryChunk {
static const int kMaxCodePageSize = 512 * MB;
private:
- static inline LargePage* Initialize(Heap* heap, MemoryChunk* chunk);
+ static inline LargePage* Initialize(Heap* heap, MemoryChunk* chunk,
+ Executability executable, Space* owner);
friend class MemoryAllocator;
};
@@ -1268,9 +1269,6 @@ class MemoryAllocator {
PageType* AllocatePage(intptr_t size, SpaceType* owner,
Executability executable);
- LargePage* AllocateLargePage(intptr_t object_size, Space* owner,
- Executability executable);
-
// PreFree logically frees the object, i.e., it takes care of the size
// bookkeeping and calls the allocation callback.
void PreFreeMemory(MemoryChunk* chunk);
@@ -2289,10 +2287,6 @@ enum SemiSpaceId { kFromSpace = 0, kToSpace = 1 };
class NewSpacePage : public MemoryChunk {
public:
- static inline NewSpacePage* Initialize(Heap* heap, MemoryChunk* chunk,
- Executability executable,
- SemiSpace* owner);
-
static bool IsAtStart(Address addr) {
return (reinterpret_cast<intptr_t>(addr) & Page::kPageAlignmentMask) ==
kObjectStartOffset;
@@ -2340,6 +2334,10 @@ class NewSpacePage : public MemoryChunk {
bool is_anchor() { return !this->InNewSpace(); }
private:
+ static inline NewSpacePage* Initialize(Heap* heap, MemoryChunk* chunk,
+ Executability executable,
+ SemiSpace* owner);
+
// GC related flags copied from from-space to to-space when
// flipping semispaces.
static const intptr_t kCopyOnFlipFlagsMask =
@@ -2355,6 +2353,7 @@ class NewSpacePage : public MemoryChunk {
// Only uses the prev/next links, and sets flags to not be in new-space.
void InitializeAsAnchor(SemiSpace* owner);
+ friend class MemoryAllocator;
friend class SemiSpace;
friend class SemiSpaceIterator;
};
« no previous file with comments | « no previous file | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698