Index: src/heap/spaces.h |
diff --git a/src/heap/spaces.h b/src/heap/spaces.h |
index 0981c3650efe8d9b6fa6b55ac4e8b06de811e6b5..7bb243a2120abc6c4d70ca9693ca44301ddfcad3 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 |
ulan
2016/06/14 15:38:51
typo PAGE_NEW_NEW_PROMOTION
Michael Lippautz
2016/06/15 06:49:30
Done.
|
+ // 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(); } |
@@ -2535,8 +2541,9 @@ class SemiSpace : public Space { |
Page anchor_; |
Page* current_page_; |
- friend class SemiSpaceIterator; |
+ friend class NewSpace; |
friend class NewSpacePageIterator; |
+ friend class SemiSpaceIterator; |
}; |
@@ -2721,6 +2728,16 @@ class NewSpace : public Space { |
return from_space_.ReplaceWithEmptyPage(page); |
} |
+ // Swaps the given |from_space_page| with a proper page in *to* space. The |
+ // method should only be called during evacuation. |
+ void SwapFromSpacePageWithToSpacePage(Page* from_space_page); |
+ |
+ // Swaps |from_space_page| with |to_space_page| by swapping their interiors |
+ // and inserting them at |from_target| and |to_target| respectively. Note |
+ // that this implies that |from_target| is in *to* space and vice versa. |
+ void SwapPages(Page* from_space_page, Page* to_space_page, Page* from_target, |
+ Page* to_target); |
+ |
// Return the maximum capacity of a semispace. |
int MaximumCapacity() { |
DCHECK(to_space_.maximum_capacity() == from_space_.maximum_capacity()); |