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

Unified Diff: src/heap/spaces.h

Issue 1863983002: 🏄 [heap] Add page evacuation mode for new->old (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Disable optimize_for_size for the feature test as we require >1 page new space 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/mark-compact.cc ('k') | 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 c7866b64fbd3c95c7ee703206900b612e3326561..00cc625a9c98d2a765cea9167d8a736cf1ffc304 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -419,6 +419,10 @@ class MemoryChunk {
// to grey transition is performed in the value.
HAS_PROGRESS_BAR,
+ // |PAGE_NEW_OLD_PROMOTION|: A page tagged with this flag has been promoted
+ // from new to old space during evacuation.
+ PAGE_NEW_OLD_PROMOTION,
+
// A black page has all mark bits set to 1 (black). A black page currently
// cannot be iterated because it is not swept. Moreover live bytes are also
// not updated.
@@ -824,6 +828,8 @@ class MemoryChunk {
// Page* p = Page::FromAllocationTop(top);
class Page : public MemoryChunk {
public:
+ static inline Page* Convert(NewSpacePage* old_page, PagedSpace* new_owner);
+
// Returns the page containing a given address. The address ranges
// from [page_addr .. page_addr + kPageSize[
// This only works if the object is in fact in a page. See also MemoryChunk::
@@ -938,6 +944,9 @@ class Page : public MemoryChunk {
inline void ClearEvacuationCandidate();
private:
+ enum InitializationMode { kFreeMemory, kDoNotFreeMemory };
+
+ template <InitializationMode mode = kFreeMemory>
static inline Page* Initialize(Heap* heap, MemoryChunk* chunk,
Executability executable, PagedSpace* owner);
@@ -1041,11 +1050,6 @@ class Space : public Malloced {
}
}
-#ifdef DEBUG
- virtual void Print() = 0;
-#endif
-
- protected:
void AccountCommitted(intptr_t bytes) {
DCHECK_GE(bytes, 0);
committed_ += bytes;
@@ -1060,6 +1064,11 @@ class Space : public Malloced {
DCHECK_GE(committed_, 0);
}
+#ifdef DEBUG
+ virtual void Print() = 0;
+#endif
+
+ protected:
v8::base::SmartPointer<List<AllocationObserver*>> allocation_observers_;
bool allocation_observers_paused_;
@@ -2355,6 +2364,8 @@ class NewSpacePage : public MemoryChunk {
(1 << MemoryChunk::POINTERS_TO_HERE_ARE_INTERESTING) |
(1 << MemoryChunk::POINTERS_FROM_HERE_ARE_INTERESTING);
+ static const intptr_t kCopyAllFlags = ~0;
+
// Create a NewSpacePage object that is only used as anchor
// for the doubly-linked list of real pages.
explicit NewSpacePage(SemiSpace* owner) { InitializeAsAnchor(owner); }
@@ -2440,6 +2451,8 @@ class SemiSpace : public Space {
// Resets the space to using the first page.
void Reset();
+ void ReplaceWithEmptyPage(NewSpacePage* page);
+
// Age mark accessors.
Address age_mark() { return age_mark_; }
void set_age_mark(Address mark);
@@ -2660,6 +2673,12 @@ class NewSpace : public Space {
inline size_t AllocatedSinceLastGC();
+ void ReplaceWithEmptyPage(NewSpacePage* page) {
+ // This method is called after flipping the semispace.
+ DCHECK(page->InFromSpace());
+ from_space_.ReplaceWithEmptyPage(page);
+ }
+
// Return the maximum capacity of a semispace.
int MaximumCapacity() {
DCHECK(to_space_.maximum_capacity() == from_space_.maximum_capacity());
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698