| Index: src/spaces.h
|
| ===================================================================
|
| --- src/spaces.h (revision 3484)
|
| +++ src/spaces.h (working copy)
|
| @@ -993,6 +993,9 @@
|
| HeapObject* SlowMCAllocateRaw(int size_in_bytes);
|
|
|
| #ifdef DEBUG
|
| + // Returns the number of total pages in this space.
|
| + int CountTotalPages();
|
| +
|
| void DoPrintRSet(const char* space_name);
|
| #endif
|
| private:
|
| @@ -1002,11 +1005,6 @@
|
| // Returns a pointer to the page of the relocation pointer.
|
| Page* MCRelocationTopPage() { return TopPageOf(mc_forwarding_info_); }
|
|
|
| -#ifdef DEBUG
|
| - // Returns the number of total pages in this space.
|
| - int CountTotalPages();
|
| -#endif
|
| -
|
| friend class PageIterator;
|
| };
|
|
|
| @@ -1740,6 +1738,17 @@
|
| // Constants.
|
| static const int kMaxMapPageIndex = (1 << MapWord::kMapPageIndexBits) - 1;
|
|
|
| + // Are map pointers encodable into map word?
|
| + bool MapPointersEncodable() {
|
| + if (!FLAG_use_big_map_space) {
|
| + ASSERT(CountTotalPages() <= kMaxMapPageIndex);
|
| + return true;
|
| + }
|
| + int n_of_pages = Capacity() / Page::kObjectAreaSize;
|
| + ASSERT(n_of_pages == CountTotalPages());
|
| + return n_of_pages <= kMaxMapPageIndex;
|
| + }
|
| +
|
| protected:
|
| #ifdef DEBUG
|
| virtual void VerifyObject(HeapObject* obj);
|
|
|