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

Side by Side Diff: src/heap/heap.cc

Issue 2552613004: [heap] Ensure finalization of incremental marking even if all allocations (Closed)
Patch Set: revert marking change 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 unified diff | Download patch
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/incremental-marking.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/heap.h" 5 #include "src/heap/heap.h"
6 6
7 #include "src/accessors.h" 7 #include "src/accessors.h"
8 #include "src/api.h" 8 #include "src/api.h"
9 #include "src/ast/context-slot-cache.h" 9 #include "src/ast/context-slot-cache.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 5279 matching lines...) Expand 10 before | Expand all | Expand 10 after
5290 } 5290 }
5291 old_generation_allocation_limit_ = limit; 5291 old_generation_allocation_limit_ = limit;
5292 } 5292 }
5293 } 5293 }
5294 5294
5295 // This predicate is called when an old generation space cannot allocated from 5295 // This predicate is called when an old generation space cannot allocated from
5296 // the free list and is about to add a new page. Returning false will cause a 5296 // the free list and is about to add a new page. Returning false will cause a
5297 // major GC. It happens when the old generation allocation limit is reached and 5297 // major GC. It happens when the old generation allocation limit is reached and
5298 // - either we need to optimize for memory usage, 5298 // - either we need to optimize for memory usage,
5299 // - or the incremental marking is not in progress and we cannot start it. 5299 // - or the incremental marking is not in progress and we cannot start it.
5300 bool Heap::ShouldExpandOldGenerationOnAllocationFailure() { 5300 bool Heap::ShouldExpandOldGenerationOnSlowAllocation() {
5301 if (always_allocate() || OldGenerationSpaceAvailable() > 0) return true; 5301 if (always_allocate() || OldGenerationSpaceAvailable() > 0) return true;
5302 // We reached the old generation allocation limit. 5302 // We reached the old generation allocation limit.
5303 5303
5304 if (ShouldOptimizeForMemoryUsage()) return false; 5304 if (ShouldOptimizeForMemoryUsage()) return false;
5305 5305
5306 if (incremental_marking()->NeedsFinalization()) {
5307 return false;
5308 }
5309
5306 if (incremental_marking()->IsStopped() && 5310 if (incremental_marking()->IsStopped() &&
5307 IncrementalMarkingLimitReached() == IncrementalMarkingLimit::kNoLimit) { 5311 IncrementalMarkingLimitReached() == IncrementalMarkingLimit::kNoLimit) {
5308 // We cannot start incremental marking. 5312 // We cannot start incremental marking.
5309 return false; 5313 return false;
5310 } 5314 }
5311 return true; 5315 return true;
5312 } 5316 }
5313 5317
5314 // This function returns either kNoLimit, kSoftLimit, or kHardLimit. 5318 // This function returns either kNoLimit, kSoftLimit, or kHardLimit.
5315 // The kNoLimit means that either incremental marking is disabled or it is too 5319 // The kNoLimit means that either incremental marking is disabled or it is too
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after
6476 } 6480 }
6477 6481
6478 6482
6479 // static 6483 // static
6480 int Heap::GetStaticVisitorIdForMap(Map* map) { 6484 int Heap::GetStaticVisitorIdForMap(Map* map) {
6481 return StaticVisitorBase::GetVisitorId(map); 6485 return StaticVisitorBase::GetVisitorId(map);
6482 } 6486 }
6483 6487
6484 } // namespace internal 6488 } // namespace internal
6485 } // namespace v8 6489 } // namespace v8
OLDNEW
« no previous file with comments | « src/heap/heap.h ('k') | src/heap/incremental-marking.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698