Lines Matching defs:state
112 // If we are transitioning to the WAIT state, start the timer.
129 // If we are transitioning to the WAIT state, start the timer.
135 bool MemoryReducer::WatchdogGC(const State& state, const Event& event) {
136 return state.last_gc_time_ms != 0 &&
137 event.time_ms > state.last_gc_time_ms + kWatchdogDelayMs;
142 MemoryReducer::State MemoryReducer::Step(const State& state,
145 return State(kDone, 0, 0, state.last_gc_time_ms, 0);
147 switch (state.action) {
150 return state;
154 static_cast<size_t>(state.committed_memory_at_last_run *
156 state.committed_memory_at_last_run + kCommittedMemoryDelta)) {
157 return state;
161 : state.last_gc_time_ms,
168 event.type == kMarkCompact ? event.time_ms : state.last_gc_time_ms,
174 return state;
176 if (state.started_gcs >= kMaxNumberOfGCs) {
177 return State(kDone, kMaxNumberOfGCs, 0.0, state.last_gc_time_ms,
181 WatchdogGC(state, event))) {
182 if (state.next_gc_start_ms <= event.time_ms) {
183 return State(kRun, state.started_gcs + 1, 0.0,
184 state.last_gc_time_ms, 0);
186 return state;
189 return State(kWait, state.started_gcs, event.time_ms + kLongDelayMs,
190 state.last_gc_time_ms, 0);
193 return State(kWait, state.started_gcs, event.time_ms + kLongDelayMs,
198 return state;
200 if (state.started_gcs < kMaxNumberOfGCs &&
201 (event.next_gc_likely_to_collect_more || state.started_gcs == 1)) {
202 return State(kWait, state.started_gcs, event.time_ms + kShortDelayMs,