Index: src/heap/memory-reducer.cc |
diff --git a/src/heap/memory-reducer.cc b/src/heap/memory-reducer.cc |
index ee1009134bc75ec9c9ed721ecc3ad0770a34a1d5..f53730785a80fcc3bcd73063f50f7471841fdecd 100644 |
--- a/src/heap/memory-reducer.cc |
+++ b/src/heap/memory-reducer.cc |
@@ -47,7 +47,7 @@ void MemoryReducer::TimerTask::RunInternal() { |
event.should_start_incremental_gc = is_idle || optimize_for_memory; |
event.can_start_incremental_gc = |
heap->incremental_marking()->IsStopped() && |
- heap->incremental_marking()->CanBeActivated(); |
+ (heap->incremental_marking()->CanBeActivated() || optimize_for_memory); |
memory_reducer_->NotifyTimer(event); |
} |
@@ -118,9 +118,8 @@ void MemoryReducer::NotifyMarkCompact(const Event& event) { |
} |
} |
- |
-void MemoryReducer::NotifyContextDisposed(const Event& event) { |
- DCHECK_EQ(kContextDisposed, event.type); |
+void MemoryReducer::NotifyPossibleGarbage(const Event& event) { |
+ DCHECK_EQ(kPossibleGarbage, event.type); |
Action old_action = state_.action; |
state_ = Step(state_, event); |
if (old_action != kWait && state_.action == kWait) { |
@@ -147,14 +146,14 @@ MemoryReducer::State MemoryReducer::Step(const State& state, |
if (event.type == kTimer) { |
return state; |
} else { |
- DCHECK(event.type == kContextDisposed || event.type == kMarkCompact); |
+ DCHECK(event.type == kPossibleGarbage || event.type == kMarkCompact); |
return State( |
kWait, 0, event.time_ms + kLongDelayMs, |
event.type == kMarkCompact ? event.time_ms : state.last_gc_time_ms); |
} |
case kWait: |
switch (event.type) { |
- case kContextDisposed: |
+ case kPossibleGarbage: |
return state; |
case kTimer: |
if (state.started_gcs >= kMaxNumberOfGCs) { |