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

Unified Diff: src/heap/heap.cc

Issue 2552613004: [heap] Ensure finalization of incremental marking even if all allocations (Closed)
Patch Set: do mark-compact instead of scavenge if incremental marking needs finalization Created 4 years 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/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 344441dfdb4bd3cc7287bc0ba5f384af7833cff1..e77ab6b58d3b550363fe4ed094a6821db7e4f194 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -264,6 +264,10 @@ GarbageCollector Heap::SelectGarbageCollector(AllocationSpace space,
return MARK_COMPACTOR;
}
+ if (incremental_marking()->NeedsFinalization()) {
+ return MARK_COMPACTOR;
+ }
+
// Is there enough space left in OLD to guarantee that a scavenge can
// succeed?
//
@@ -5297,12 +5301,16 @@ void Heap::DampenOldGenerationAllocationLimit(size_t old_gen_size,
// major GC. It happens when the old generation allocation limit is reached and
// - either we need to optimize for memory usage,
// - or the incremental marking is not in progress and we cannot start it.
-bool Heap::ShouldExpandOldGenerationOnAllocationFailure() {
+bool Heap::ShouldExpandOldGenerationOnSlowAllocation() {
if (always_allocate() || OldGenerationSpaceAvailable() > 0) return true;
// We reached the old generation allocation limit.
if (ShouldOptimizeForMemoryUsage()) return false;
+ if (incremental_marking()->NeedsFinalization()) {
+ return false;
+ }
+
if (incremental_marking()->IsStopped() &&
IncrementalMarkingLimitReached() == IncrementalMarkingLimit::kNoLimit) {
// We cannot start incremental marking.

Powered by Google App Engine
This is Rietveld 408576698