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 1957323003: [heap] Add page evacuation mode for new->new (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase after fix 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
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index fbbd9da8dff89812fc38f318e48a99e161d58503..130e2dd134180eb246665b199af3a7a3361e34ad 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_PROMITION|: 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.
@@ -2440,6 +2444,8 @@ class SemiSpace : public Space {
Page* first_page() { return anchor_.next_page(); }
Page* current_page() { return current_page_; }
+ bool OnLastPage() { return current_page() == anchor()->prev_page(); }
+
// Returns one past the end address of the space.
Address space_end() { return anchor_.prev_page()->area_end(); }
@@ -2460,6 +2466,7 @@ class SemiSpace : public Space {
void Reset();
bool ReplaceWithEmptyPage(Page* page);
+ void PrependPage(Page* page);
// Age mark accessors.
Address age_mark() { return age_mark_; }
@@ -2721,6 +2728,13 @@ class NewSpace : public Space {
return from_space_.ReplaceWithEmptyPage(page);
}
+ void AddPageToToSpace(Page* page) {
+ DCHECK(page->InFromSpace());
+ DCHECK(!to_space_.OnLastPage());
+ to_space_.PrependPage(page);
+ pages_used_++;
+ }
+
// Return the maximum capacity of a semispace.
int MaximumCapacity() {
DCHECK(to_space_.maximum_capacity() == from_space_.maximum_capacity());
« src/heap/mark-compact.cc ('K') | « 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