[heap] Enfoce tighter allocation limit for large object allocations.

BUG=chromium:574953
LOG=n

Review URL: https://codereview.chromium.org/1570443004

Cr-Commit-Position: refs/heads/master@{#33179}
This commit is contained in:
hpayer 2016-01-08 06:52:58 -08:00 committed by Commit bot
parent 45850f4012
commit 320ee1b8d7
3 changed files with 4 additions and 4 deletions

View File

@ -942,7 +942,8 @@ bool Heap::CollectGarbage(GarbageCollector collector, const char* gc_reason,
if (collector == MARK_COMPACTOR && !ShouldFinalizeIncrementalMarking() &&
!ShouldAbortIncrementalMarking() && !incremental_marking()->IsStopped() &&
!incremental_marking()->should_hurry() && FLAG_incremental_marking) {
!incremental_marking()->should_hurry() && FLAG_incremental_marking &&
OldGenerationAllocationLimitReached()) {
// Make progress in incremental marking.
const intptr_t kStepSizeWhenDelayedByScavenge = 1 * MB;
incremental_marking()->Step(kStepSizeWhenDelayedByScavenge,

View File

@ -825,7 +825,7 @@ class Heap {
// TODO(hpayer): There is still a missmatch between capacity and actual
// committed memory size.
bool CanExpandOldGeneration(int size) {
bool CanExpandOldGeneration(int size = 0) {
if (force_oom_) return false;
return (CommittedOldGenerationMemory() + size) < MaxOldGenerationSize();
}

View File

@ -3100,8 +3100,7 @@ AllocationResult LargeObjectSpace::AllocateRaw(int object_size,
Executability executable) {
// Check if we want to force a GC before growing the old space further.
// If so, fail the allocation.
if (!heap()->always_allocate() &&
!heap()->CanExpandOldGeneration(object_size)) {
if (!heap()->CanExpandOldGeneration(object_size)) {
return AllocationResult::Retry(identity());
}