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

Unified Diff: src/heap/spaces.h

Issue 1957323003: [heap] Add page evacuation mode for new->new (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Switch threshold flag back to 70 Created 4 years, 6 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 0981c3650efe8d9b6fa6b55ac4e8b06de811e6b5..37d43b17c4c72f8ff482f6192466f6f4d16d8672 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -425,6 +425,10 @@ class MemoryChunk {
// from new to old space during evacuation.
PAGE_NEW_OLD_PROMOTION,
+ // |PAGE_NEW_NEW_PROMOTION|: A page tagged with this flag has been moved
+ // within the new space during evacuation.
+ PAGE_NEW_NEW_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.
@@ -2431,6 +2435,8 @@ class SemiSpace : public Space {
// than the current capacity.
bool ShrinkTo(int new_capacity);
+ bool EnsureCurrentCapacity();
+
// Returns the start address of the first page of the space.
Address space_start() {
DCHECK_NE(anchor_.next_page(), anchor());
@@ -2459,7 +2465,8 @@ class SemiSpace : public Space {
// Resets the space to using the first page.
void Reset();
- bool ReplaceWithEmptyPage(Page* page);
+ void RemovePage(Page* page);
+ void PrependPage(Page* page);
// Age mark accessors.
Address age_mark() { return age_mark_; }
@@ -2535,8 +2542,9 @@ class SemiSpace : public Space {
Page anchor_;
Page* current_page_;
- friend class SemiSpaceIterator;
+ friend class NewSpace;
friend class NewSpacePageIterator;
+ friend class SemiSpaceIterator;
};
@@ -2715,12 +2723,15 @@ class NewSpace : public Space {
return static_cast<size_t>(allocated);
}
- bool ReplaceWithEmptyPage(Page* page) {
- // This method is called after flipping the semispace.
+ void MovePageFromSpaceToSpace(Page* page) {
DCHECK(page->InFromSpace());
- return from_space_.ReplaceWithEmptyPage(page);
+ from_space_.RemovePage(page);
+ to_space_.PrependPage(page);
+ pages_used_++;
}
+ bool Rebalance();
+
// 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