Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(373)

Side by Side Diff: src/heap/spaces.h

Issue 1403633004: [heap] Reland decrease large object limit for regular heap objects. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/heap/scavenger.cc ('k') | src/heap/spaces-inl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_HEAP_SPACES_H_ 5 #ifndef V8_HEAP_SPACES_H_
6 #define V8_HEAP_SPACES_H_ 6 #define V8_HEAP_SPACES_H_
7 7
8 #include "src/allocation.h" 8 #include "src/allocation.h"
9 #include "src/atomic-utils.h" 9 #include "src/atomic-utils.h"
10 #include "src/base/atomicops.h" 10 #include "src/base/atomicops.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 79
80 #define DCHECK_PAGE_ALIGNED(address) \ 80 #define DCHECK_PAGE_ALIGNED(address) \
81 DCHECK((OffsetFrom(address) & Page::kPageAlignmentMask) == 0) 81 DCHECK((OffsetFrom(address) & Page::kPageAlignmentMask) == 0)
82 82
83 #define DCHECK_OBJECT_ALIGNED(address) \ 83 #define DCHECK_OBJECT_ALIGNED(address) \
84 DCHECK((OffsetFrom(address) & kObjectAlignmentMask) == 0) 84 DCHECK((OffsetFrom(address) & kObjectAlignmentMask) == 0)
85 85
86 #define DCHECK_OBJECT_SIZE(size) \ 86 #define DCHECK_OBJECT_SIZE(size) \
87 DCHECK((0 < size) && (size <= Page::kMaxRegularHeapObjectSize)) 87 DCHECK((0 < size) && (size <= Page::kMaxRegularHeapObjectSize))
88 88
89 #define DCHECK_CODEOBJECT_SIZE(size, code_space) \
90 DCHECK((0 < size) && (size <= code_space->AreaSize()))
91
89 #define DCHECK_PAGE_OFFSET(offset) \ 92 #define DCHECK_PAGE_OFFSET(offset) \
90 DCHECK((Page::kObjectStartOffset <= offset) && (offset <= Page::kPageSize)) 93 DCHECK((Page::kObjectStartOffset <= offset) && (offset <= Page::kPageSize))
91 94
92 #define DCHECK_MAP_PAGE_INDEX(index) \ 95 #define DCHECK_MAP_PAGE_INDEX(index) \
93 DCHECK((0 <= index) && (index <= MapSpace::kMaxMapPageIndex)) 96 DCHECK((0 <= index) && (index <= MapSpace::kMaxMapPageIndex))
94 97
95 class AllocationInfo; 98 class AllocationInfo;
96 class CompactionSpace; 99 class CompactionSpace;
97 class FreeList; 100 class FreeList;
98 class MemoryAllocator; 101 class MemoryAllocator;
(...skipping 734 matching lines...) Expand 10 before | Expand all | Expand 10 after
833 // --------------------------------------------------------------------- 836 // ---------------------------------------------------------------------
834 837
835 // Page size in bytes. This must be a multiple of the OS page size. 838 // Page size in bytes. This must be a multiple of the OS page size.
836 static const int kPageSize = 1 << kPageSizeBits; 839 static const int kPageSize = 1 << kPageSizeBits;
837 840
838 // Maximum object size that gets allocated into regular pages. Objects larger 841 // Maximum object size that gets allocated into regular pages. Objects larger
839 // than that size are allocated in large object space and are never moved in 842 // than that size are allocated in large object space and are never moved in
840 // memory. This also applies to new space allocation, since objects are never 843 // memory. This also applies to new space allocation, since objects are never
841 // migrated from new space to large object space. Takes double alignment into 844 // migrated from new space to large object space. Takes double alignment into
842 // account. 845 // account.
843 static const int kMaxRegularHeapObjectSize = kPageSize - kObjectStartOffset; 846 // TODO(hpayer): This limit should be way smaller but we currently have
847 // short living objects >256K.
848 static const int kMaxRegularHeapObjectSize = 600 * KB;
844 849
845 static const int kAllocatableMemory = kPageSize - kObjectStartOffset; 850 static const int kAllocatableMemory = kPageSize - kObjectStartOffset;
846 851
847 // Page size mask. 852 // Page size mask.
848 static const intptr_t kPageAlignmentMask = (1 << kPageSizeBits) - 1; 853 static const intptr_t kPageAlignmentMask = (1 << kPageSizeBits) - 1;
849 854
850 inline void ClearGCFields(); 855 inline void ClearGCFields();
851 856
852 static inline Page* Initialize(Heap* heap, MemoryChunk* chunk, 857 static inline Page* Initialize(Heap* heap, MemoryChunk* chunk,
853 Executability executable, PagedSpace* owner); 858 Executability executable, PagedSpace* owner);
(...skipping 2155 matching lines...) Expand 10 before | Expand all | Expand 10 after
3009 count = 0; 3014 count = 0;
3010 } 3015 }
3011 // Must be small, since an iteration is used for lookup. 3016 // Must be small, since an iteration is used for lookup.
3012 static const int kMaxComments = 64; 3017 static const int kMaxComments = 64;
3013 }; 3018 };
3014 #endif 3019 #endif
3015 } // namespace internal 3020 } // namespace internal
3016 } // namespace v8 3021 } // namespace v8
3017 3022
3018 #endif // V8_HEAP_SPACES_H_ 3023 #endif // V8_HEAP_SPACES_H_
OLDNEW
« no previous file with comments | « src/heap/scavenger.cc ('k') | src/heap/spaces-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698