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

Unified Diff: src/heap/spaces.h

Issue 2311203002: Move kMaxRegularHeapObjectSize into globals (Closed)
Patch Set: Saving the file helps... Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/heap/objects-visiting.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index 747055db7bc5ccb64f24a7236996be2df881d13c..964c9d2c5fb164d0d1d5e46eec480c1b12332bc5 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -16,6 +16,7 @@
#include "src/base/hashmap.h"
#include "src/base/platform/mutex.h"
#include "src/flags.h"
+#include "src/globals.h"
#include "src/heap/marking.h"
#include "src/list.h"
#include "src/objects.h"
@@ -57,7 +58,7 @@ class Space;
// area.
//
// There is a separate large object space for objects larger than
-// Page::kMaxRegularHeapObjectSize, so that they do not have to move during
+// kMaxRegularHeapObjectSize, so that they do not have to move during
// collection. The large object space is paged. Pages in large object space
// may be larger than the page size.
//
@@ -105,7 +106,7 @@ class Space;
DCHECK((OffsetFrom(address) & kObjectAlignmentMask) == 0)
#define DCHECK_OBJECT_SIZE(size) \
- DCHECK((0 < size) && (size <= Page::kMaxRegularHeapObjectSize))
+ DCHECK((0 < size) && (size <= kMaxRegularHeapObjectSize))
#define DCHECK_CODEOBJECT_SIZE(size, code_space) \
DCHECK((0 < size) && (size <= code_space->AreaSize()))
@@ -694,6 +695,8 @@ class MemoryChunk {
DEFINE_OPERATORS_FOR_FLAGS(MemoryChunk::Flags)
+STATIC_ASSERT(kMaxRegularHeapObjectSize < MemoryChunk::kAllocatableMemory);
+
// -----------------------------------------------------------------------------
// A page is a memory chunk of a size 1MB. Large object pages may be larger.
//
@@ -709,15 +712,6 @@ class Page : public MemoryChunk {
static_cast<intptr_t>(MemoryChunk::POINTERS_TO_HERE_ARE_INTERESTING) |
static_cast<intptr_t>(MemoryChunk::POINTERS_FROM_HERE_ARE_INTERESTING);
- // 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.
- // TODO(hpayer): This limit should be way smaller but we currently have
- // short living objects >256K.
- static const int kMaxRegularHeapObjectSize = 512 * KB - Page::kHeaderSize;
-
static inline Page* ConvertNewToOld(Page* old_page, PagedSpace* new_owner);
// Returns the page containing a given address. The address ranges
@@ -2893,7 +2887,7 @@ class MapSpace : public PagedSpace {
// -----------------------------------------------------------------------------
-// Large objects ( > Page::kMaxRegularHeapObjectSize ) are allocated and
+// Large objects ( > kMaxRegularHeapObjectSize ) are allocated and
// managed by the large object space. A large object is allocated from OS
// heap with extra padding bytes (Page::kPageSize + Page::kObjectStartOffset).
// A large object always starts at Page::kObjectStartOffset to a page.
« no previous file with comments | « src/heap/objects-visiting.h ('k') | src/ia32/code-stubs-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698