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

Unified Diff: src/heap/spaces.cc

Issue 979783002: Respect accumulative old generation memory limit in all spaces. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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/heap.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.cc
diff --git a/src/heap/spaces.cc b/src/heap/spaces.cc
index 30ae2b44f0a811d652d58ee93154903ba493b553..39e5100baeb0a75d8b4d8c7beea469471ccde2e8 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -1021,13 +1021,12 @@ Object* PagedSpace::FindObject(Address addr) {
bool PagedSpace::CanExpand() {
DCHECK(max_capacity_ % AreaSize() == 0);
-
- if (Capacity() == max_capacity_) return false;
-
- DCHECK(Capacity() < max_capacity_);
+ DCHECK(Capacity() <= heap()->MaxOldGenerationSize());
+ DCHECK(heap()->CommittedOldGenerationMemory() <=
+ heap()->MaxOldGenerationSize());
// Are we going to exceed capacity for this space?
- if ((Capacity() + Page::kPageSize) > max_capacity_) return false;
+ if (!heap()->CanExpandOldGeneration(Page::kPageSize)) return false;
return true;
}
@@ -1049,7 +1048,9 @@ bool PagedSpace::Expand() {
// Pages created during bootstrapping may contain immortal immovable objects.
if (!heap()->deserialization_complete()) p->MarkNeverEvacuate();
- DCHECK(Capacity() <= max_capacity_);
+ DCHECK(Capacity() <= heap()->MaxOldGenerationSize());
+ DCHECK(heap()->CommittedOldGenerationMemory() <=
+ heap()->MaxOldGenerationSize());
p->InsertAfter(anchor_.prev_page());
« no previous file with comments | « src/heap/heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698