Commit 8833af23 authored by hpayer's avatar hpayer Committed by Commit bot

[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}
parent b7b3781b
......@@ -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_);
}
}
......
......@@ -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.
......
......@@ -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()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment