Chromium Code Reviews| 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); |
|
ulan
2016/06/10 12:58:54
A description of pre/post condition of this functi
Michael Lippautz
2016/06/10 15:18:16
Added comments to the new functions.
|
| // 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()); |