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

Unified Diff: src/heap/spaces.h

Issue 2232653003: Reland of "[heap] Switch to 500k pages" (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Switch back to using the high water mark. Also: dont sweep immortal immovable pages Created 4 years, 4 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
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index c035342bfa85058dd9be34024e17cbc6d5722be3..192f61a65d6bd13b48c4020b8303706c5133074f 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -234,7 +234,15 @@ class MemoryChunk {
IN_TO_SPACE, // All pages in new space has one of these two set.
NEW_SPACE_BELOW_AGE_MARK,
EVACUATION_CANDIDATE,
- NEVER_EVACUATE, // May contain immortal immutables.
+
+ // |NEVER_EVACUATE|: A page tagged with this flag will never be selected
+ // for evacuation. Typically used for immortal immovable pages.
+ NEVER_EVACUATE,
+
+ // |NEVER_SWEEP|: A page tagged with this flag will be ignored by the
+ // sweeper. The memory will always be accounted for as allocated. Typically
+ // used for immortal immovable pages.
+ NEVER_SWEEP,
// Large objects can have a progress bar in their page header. These object
// are scanned in increments and will be kept black while being scanned.
@@ -689,7 +697,7 @@ class Page : public MemoryChunk {
// account.
// TODO(hpayer): This limit should be way smaller but we currently have
// short living objects >256K.
- static const int kMaxRegularHeapObjectSize = 600 * KB;
+ static const int kMaxRegularHeapObjectSize = 400 * KB;
static inline Page* ConvertNewToOld(Page* old_page, PagedSpace* new_owner);
@@ -1270,6 +1278,8 @@ class MemoryAllocator {
intptr_t commit_area_size,
Executability executable, Space* space);
+ void ShrinkChunk(MemoryChunk* chunk, size_t bytes_to_shrink);
+
Address ReserveAlignedMemory(size_t requested, size_t alignment,
base::VirtualMemory* controller);
Address AllocateAlignedMemory(size_t reserve_size, size_t commit_size,
@@ -1575,6 +1585,7 @@ class AllocationStats BASE_EMBEDDED {
capacity_ -= size_in_bytes;
size_ -= size_in_bytes;
CHECK_GE(size_, 0);
+ CHECK_GE(capacity_, 0);
}
// Allocate from available bytes (available -> size).
@@ -2140,6 +2151,10 @@ class PagedSpace : public Space {
iterator begin() { return iterator(anchor_.next_page()); }
iterator end() { return iterator(&anchor_); }
+ // Shrink immortal immovable pages of the space to be exactly the size needed
+ // using the high water mark.
+ void ShrinkImmortalImmovablePages();
+
protected:
// PagedSpaces that should be included in snapshots have different, i.e.,
// smaller, initial pages.
« no previous file with comments | « src/heap/mark-compact.cc ('k') | src/heap/spaces.cc » ('j') | src/heap/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698