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( ...@@ -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(); gc_idle_time_handler_->ResetNoProgressCounter();
StartIncrementalMarking(kReduceMemoryFootprintMask, gc_reason, StartIncrementalMarking(kReduceMemoryFootprintMask, gc_reason,
kNoGCCallbackFlags); gc_callback_flags);
} }
...@@ -4232,7 +4234,7 @@ void Heap::FinalizeIncrementalMarkingIfComplete( ...@@ -4232,7 +4234,7 @@ void Heap::FinalizeIncrementalMarkingIfComplete(
(mark_compact_collector()->marking_deque()->IsEmpty() && (mark_compact_collector()->marking_deque()->IsEmpty() &&
local_embedder_heap_tracer() local_embedder_heap_tracer()
->ShouldFinalizeIncrementalMarking())) { ->ShouldFinalizeIncrementalMarking())) {
CollectAllGarbage(current_gc_flags_, gc_reason); CollectAllGarbage(current_gc_flags_, gc_reason, current_gc_callback_flags_);
} }
} }
......
...@@ -1239,7 +1239,9 @@ class Heap { ...@@ -1239,7 +1239,9 @@ class Heap {
// Start incremental marking and ensure that idle time handler can perform // Start incremental marking and ensure that idle time handler can perform
// incremental steps. // 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 // Starts incremental marking assuming incremental marking is currently
// stopped. // stopped.
......
...@@ -66,7 +66,8 @@ void MemoryReducer::NotifyTimer(const Event& event) { ...@@ -66,7 +66,8 @@ void MemoryReducer::NotifyTimer(const Event& event) {
state_.started_gcs); state_.started_gcs);
} }
heap()->StartIdleIncrementalMarking( heap()->StartIdleIncrementalMarking(
GarbageCollectionReason::kMemoryReducer); GarbageCollectionReason::kMemoryReducer,
kGCCallbackFlagCollectAllExternalMemory);
} else if (state_.action == kWait) { } else if (state_.action == kWait) {
if (!heap()->incremental_marking()->IsStopped() && if (!heap()->incremental_marking()->IsStopped() &&
heap()->ShouldOptimizeForMemoryUsage()) { 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