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

Unified Diff: src/heap/spaces.cc

Issue 1864433003: [heap] Old generation limit is based on capacity. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 8 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') | test/cctest/heap/test-heap.cc » ('j') | 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 6d30f31c7ca2c09196716cd64ef1b5183035fcc1..02c4678307091c9320b19ad38c499ee0f8eebb5b 100644
--- a/src/heap/spaces.cc
+++ b/src/heap/spaces.cc
@@ -1138,26 +1138,13 @@ Object* PagedSpace::FindObject(Address addr) {
}
-bool PagedSpace::CanExpand(size_t size) {
- DCHECK(heap()->mark_compact_collector()->is_compacting() ||
- Capacity() <= heap()->MaxOldGenerationSize());
-
- // Are we going to exceed capacity for this space? At this point we can be
- // way over the maximum size because of AlwaysAllocate scopes and large
- // objects.
- if (!heap()->CanExpandOldGeneration(static_cast<int>(size))) return false;
-
- return true;
-}
-
-
bool PagedSpace::Expand() {
- intptr_t size = AreaSize();
+ int size = AreaSize();
if (snapshotable() && !HasPages()) {
size = Snapshot::SizeOfFirstPage(heap()->isolate(), identity());
}
- if (!CanExpand(size)) return false;
+ if (!heap()->CanExpandOldGeneration(size)) return false;
Page* p = heap()->isolate()->memory_allocator()->AllocatePage(size, this,
executable());
« no previous file with comments | « src/heap/heap.cc ('k') | test/cctest/heap/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698