| Index: src/heap/spaces.h
|
| diff --git a/src/heap/spaces.h b/src/heap/spaces.h
|
| index 222380856bfe7286b50a63eee2e37544a1f7e512..02be4f9be39fd6523d7a0a84efa5fb9d68ae3888 100644
|
| --- a/src/heap/spaces.h
|
| +++ b/src/heap/spaces.h
|
| @@ -84,7 +84,7 @@ class Isolate;
|
| DCHECK((OffsetFrom(address) & kObjectAlignmentMask) == 0)
|
|
|
| #define DCHECK_OBJECT_SIZE(size) \
|
| - DCHECK((0 < size) && (size <= Page::kMaxRegularHeapObjectSize))
|
| + DCHECK((0 < size) && (size <= Page::kAllocatableMemory))
|
|
|
| #define DCHECK_PAGE_OFFSET(offset) \
|
| DCHECK((Page::kObjectStartOffset <= offset) && (offset <= Page::kPageSize))
|
| @@ -811,12 +811,15 @@ class Page : public MemoryChunk {
|
| // Page size in bytes. This must be a multiple of the OS page size.
|
| static const int kPageSize = 1 << kPageSizeBits;
|
|
|
| - // Maximum object size that fits in a page. Objects larger than that size
|
| - // are allocated in large object space and are never moved in memory. This
|
| - // also applies to new space allocation, since objects are never migrated
|
| - // from new space to large object space. Takes double alignment into account.
|
| + // Maximum object size that gets allocated into regular pages. Objects larger
|
| + // than that size are allocated in large object space and are never moved in
|
| + // memory. This also applies to new space allocation, since objects are never
|
| + // migrated from new space to large object space. Takes double alignment into
|
| + // account.
|
| static const int kMaxRegularHeapObjectSize = kPageSize - kObjectStartOffset;
|
|
|
| + static const int kAllocatableMemory = kPageSize - kObjectStartOffset;
|
| +
|
| // Page size mask.
|
| static const intptr_t kPageAlignmentMask = (1 << kPageSizeBits) - 1;
|
|
|
| @@ -1147,7 +1150,7 @@ class MemoryAllocator {
|
|
|
| // Returns maximum available bytes that the old space can have.
|
| intptr_t MaxAvailable() {
|
| - return (Available() / Page::kPageSize) * Page::kMaxRegularHeapObjectSize;
|
| + return (Available() / Page::kPageSize) * Page::kAllocatableMemory;
|
| }
|
|
|
| // Returns an indication of whether a pointer is in a space that has
|
| @@ -1223,7 +1226,7 @@ class MemoryAllocator {
|
| static int PageAreaSize(AllocationSpace space) {
|
| DCHECK_NE(LO_SPACE, space);
|
| return (space == CODE_SPACE) ? CodePageAreaSize()
|
| - : Page::kMaxRegularHeapObjectSize;
|
| + : Page::kAllocatableMemory;
|
| }
|
|
|
| MUST_USE_RESULT bool CommitExecutableMemory(base::VirtualMemory* vm,
|
| @@ -1684,7 +1687,7 @@ class FreeList {
|
| private:
|
| // The size range of blocks, in bytes.
|
| static const int kMinBlockSize = 3 * kPointerSize;
|
| - static const int kMaxBlockSize = Page::kMaxRegularHeapObjectSize;
|
| + static const int kMaxBlockSize = Page::kAllocatableMemory;
|
|
|
| static const int kSmallListMin = 0x1f * kPointerSize;
|
| static const int kSmallListMax = 0xff * kPointerSize;
|
| @@ -2103,7 +2106,7 @@ class NewSpacePage : public MemoryChunk {
|
| (1 << MemoryChunk::POINTERS_FROM_HERE_ARE_INTERESTING) |
|
| (1 << MemoryChunk::SCAN_ON_SCAVENGE);
|
|
|
| - static const int kAreaSize = Page::kMaxRegularHeapObjectSize;
|
| + static const int kAreaSize = Page::kAllocatableMemory;
|
|
|
| inline NewSpacePage* next_page() {
|
| return static_cast<NewSpacePage*>(next_chunk());
|
| @@ -2822,7 +2825,7 @@ class MapSpace : public PagedSpace {
|
| virtual void VerifyObject(HeapObject* obj);
|
|
|
| private:
|
| - static const int kMapsPerPage = Page::kMaxRegularHeapObjectSize / Map::kSize;
|
| + static const int kMapsPerPage = Page::kAllocatableMemory / Map::kSize;
|
|
|
| // Do map space compaction if there is a page gap.
|
| int CompactionThreshold() {
|
|
|