[heap] Memory reducer calls GC with kGCCallbackFlagCollectAllExternalMemory flag.

BUG=chromium:718484

Review-Url: https://codereview.chromium.org/2863943002
Cr-Commit-Position: refs/heads/master@{#45128}
This commit is contained in:
hpayer 2017-05-05 04:24:02 -07:00 committed by Commit bot
parent b7b3781b87
commit 8833af23e9
3 changed files with 10 additions and 5 deletions

View File

@ -1115,10 +1115,12 @@ void Heap::StartIncrementalMarkingIfAllocationLimitIsReached(
}
}
void Heap::StartIdleIncrementalMarking(GarbageCollectionReason gc_reason) {
void Heap::StartIdleIncrementalMarking(
GarbageCollectionReason gc_reason,
const GCCallbackFlags gc_callback_flags) {
gc_idle_time_handler_->ResetNoProgressCounter();
StartIncrementalMarking(kReduceMemoryFootprintMask, gc_reason,
kNoGCCallbackFlags);
gc_callback_flags);
}
@ -4232,7 +4234,7 @@ void Heap::FinalizeIncrementalMarkingIfComplete(
(mark_compact_collector()->marking_deque()->IsEmpty() &&
local_embedder_heap_tracer()
->ShouldFinalizeIncrementalMarking())) {
CollectAllGarbage(current_gc_flags_, gc_reason);
CollectAllGarbage(current_gc_flags_, gc_reason, current_gc_callback_flags_);
}
}

View File

@ -1239,7 +1239,9 @@ class Heap {
// Start incremental marking and ensure that idle time handler can perform
// incremental steps.
void StartIdleIncrementalMarking(GarbageCollectionReason gc_reason);
void StartIdleIncrementalMarking(
GarbageCollectionReason gc_reason,
GCCallbackFlags gc_callback_flags = GCCallbackFlags::kNoGCCallbackFlags);
// Starts incremental marking assuming incremental marking is currently
// stopped.

View File

@ -66,7 +66,8 @@ void MemoryReducer::NotifyTimer(const Event& event) {
state_.started_gcs);
}
heap()->StartIdleIncrementalMarking(
GarbageCollectionReason::kMemoryReducer);
GarbageCollectionReason::kMemoryReducer,
kGCCallbackFlagCollectAllExternalMemory);
} else if (state_.action == kWait) {
if (!heap()->incremental_marking()->IsStopped() &&
heap()->ShouldOptimizeForMemoryUsage()) {