Chromium Code Reviews| Index: src/spaces.cc |
| diff --git a/src/spaces.cc b/src/spaces.cc |
| index d8aecf3951ab98da3223637c668c20819825b53a..a69b11e7f1941451794ca9c0b9e1d4180879cc83 100644 |
| --- a/src/spaces.cc |
| +++ b/src/spaces.cc |
| @@ -1122,6 +1122,12 @@ void PagedSpace::ResetFreeListStatistics() { |
| } |
| +void PagedSpace::IncreaseCapacity(int size) { |
| + accounting_stats_.ExpandSpace(size); |
| + heap()->UpdateMaximumCommitted(); |
|
Hannes Payer (out of office)
2013/10/22 14:46:07
Instead of calling heap()->UpdateMaximumCommitted(
rmcilroy
2013/10/23 14:40:23
The heap size can be increased when there is no GC
Hannes Payer (out of office)
2013/10/24 08:12:35
Beginning of GC is what I meant, that should be fi
rmcilroy
2013/10/24 16:34:31
Done.
|
| +} |
| + |
| + |
| void PagedSpace::ReleasePage(Page* page, bool unlink) { |
| ASSERT(page->LiveBytes() == 0); |
| ASSERT(AreaSize() == page->area_size()); |
| @@ -1509,6 +1515,7 @@ void SemiSpace::SetUp(Address start, |
| initial_capacity_ = RoundDown(initial_capacity, Page::kPageSize); |
| capacity_ = initial_capacity; |
| maximum_capacity_ = RoundDown(maximum_capacity, Page::kPageSize); |
| + maximum_committed_ = 0; |
| committed_ = false; |
| start_ = start; |
| address_mask_ = ~(maximum_capacity - 1); |
| @@ -1541,6 +1548,10 @@ bool SemiSpace::Commit() { |
| current = new_page; |
| } |
| + if (capacity_ > maximum_committed_) { |
| + maximum_committed_ = capacity_; |
| + heap()->UpdateMaximumCommitted(); |
| + } |
|
Hannes Payer (out of office)
2013/10/22 14:46:07
Instead of duplicating this code, why don't we add
rmcilroy
2013/10/23 14:40:23
Done.
|
| committed_ = true; |
| Reset(); |
| return true; |
| @@ -1604,6 +1615,10 @@ bool SemiSpace::GrowTo(int new_capacity) { |
| NewSpacePage::kCopyOnFlipFlagsMask); |
| last_page = new_page; |
| } |
| + if (capacity_ > maximum_committed_) { |
| + maximum_committed_ = capacity_; |
| + heap()->UpdateMaximumCommitted(); |
| + } |
| return true; |
| } |
| @@ -2935,6 +2950,7 @@ LargeObjectSpace::LargeObjectSpace(Heap* heap, |
| bool LargeObjectSpace::SetUp() { |
| first_page_ = NULL; |
| size_ = 0; |
| + maximum_committed_ = 0; |
| page_count_ = 0; |
| objects_size_ = 0; |
| chunk_map_.Clear(); |
| @@ -2981,6 +2997,11 @@ MaybeObject* LargeObjectSpace::AllocateRaw(int object_size, |
| page->set_next_page(first_page_); |
| first_page_ = page; |
| + if (size_ > maximum_committed_) { |
| + maximum_committed_ = size_; |
| + heap()->UpdateMaximumCommitted(); |
| + } |
| + |
| // Register all MemoryChunk::kAlignment-aligned chunks covered by |
| // this large page in the chunk map. |
| uintptr_t base = reinterpret_cast<uintptr_t>(page) / MemoryChunk::kAlignment; |