Chromium Code Reviews| Index: src/heap/spaces.h |
| diff --git a/src/heap/spaces.h b/src/heap/spaces.h |
| index 6832458a16f05df9f78adb16580e0293e69ed471..c5133637b28fda0a0153585d39565a10edb7e63b 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, |
| + // A fast evacuation page has been moved from new space to old space during |
| + // evacuation. |
| + FAST_NEW_OLD_EVACUATION, |
|
Hannes Payer (out of office)
2016/04/18 12:12:23
Keep this page flag in sync with the regular flags
Michael Lippautz
2016/04/18 12:57:38
Done.
|
| + |
| // 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. |
| @@ -820,6 +824,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:: |
| @@ -934,6 +940,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); |
| @@ -1037,11 +1046,6 @@ class Space : public Malloced { |
| } |
| } |
| -#ifdef DEBUG |
| - virtual void Print() = 0; |
| -#endif |
| - |
| - protected: |
| void AccountCommitted(intptr_t bytes) { |
| DCHECK_GE(bytes, 0); |
| committed_ += bytes; |
| @@ -1056,6 +1060,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_; |
| @@ -2351,6 +2360,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); } |
| @@ -2436,6 +2447,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); |
| @@ -2653,6 +2666,12 @@ class NewSpace : public Space { |
| // Return the available bytes without growing. |
| intptr_t Available() override { return Capacity() - Size(); } |
| + void ReplaceWithEmptyPage(NewSpacePage* page) { |
| + // This method is called after flipping the semispace. |
| + DCHECK(page->InFromSpace()); |
| + from_space_.ReplaceWithEmptyPage(page); |
| + } |
| + |
| size_t AllocatedSinceLastGC() { |
| bool seen_age_mark = false; |
| Address age_mark = to_space_.age_mark(); |