Chromium Code Reviews| Index: src/heap/gc-idle-time-handler.cc |
| diff --git a/src/heap/gc-idle-time-handler.cc b/src/heap/gc-idle-time-handler.cc |
| index 730d2bb2568888ca8208e875c0ab6587cab101b1..9bc7078c7461c1782006f5089f33dbbeb6e1a9b2 100644 |
| --- a/src/heap/gc-idle-time-handler.cc |
| +++ b/src/heap/gc-idle-time-handler.cc |
| @@ -189,9 +189,9 @@ bool GCIdleTimeHandler::ShouldDoFinalIncrementalMarkCompact( |
| // request, we finalize sweeping here. |
| // (6) If incremental marking is in progress, we perform a marking step. Note, |
| // that this currently may trigger a full garbage collection. |
| -GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms, |
| +GCIdleTimeAction GCIdleTimeHandler::Compute(double idle_time_in_ms, |
|
rmcilroy
2014/11/26 11:35:41
Maybe just keep this as a size_t since you cast it
Hannes Payer (out of office)
2014/11/27 12:19:15
Nope, idle_time_in_ms can be negative in the deadl
|
| HeapState heap_state) { |
| - if (idle_time_in_ms == 0) { |
| + if (idle_time_in_ms <= 0.0) { |
| if (heap_state.incremental_marking_stopped) { |
| if (ShouldDoContextDisposalMarkCompact( |
| heap_state.contexts_disposed, |
| @@ -203,7 +203,7 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms, |
| } |
| if (ShouldDoScavenge( |
| - idle_time_in_ms, heap_state.new_space_capacity, |
| + static_cast<size_t>(idle_time_in_ms), heap_state.new_space_capacity, |
| heap_state.used_new_space_size, |
| heap_state.scavenge_speed_in_bytes_per_ms, |
| heap_state.new_space_allocation_throughput_in_bytes_per_ms)) { |
| @@ -219,7 +219,8 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms, |
| } |
| if (heap_state.incremental_marking_stopped) { |
| - if (ShouldDoMarkCompact(idle_time_in_ms, heap_state.size_of_objects, |
| + if (ShouldDoMarkCompact(static_cast<size_t>(idle_time_in_ms), |
| + heap_state.size_of_objects, |
| heap_state.mark_compact_speed_in_bytes_per_ms)) { |
| // If there are no more than two GCs left in this idle round and we are |
| // allowed to do a full GC, then make those GCs full in order to compact |
| @@ -228,7 +229,7 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms, |
| // can get rid of this special case and always start incremental marking. |
| int remaining_mark_sweeps = |
| kMaxMarkCompactsInIdleRound - mark_compacts_since_idle_round_started_; |
| - if (idle_time_in_ms > kMaxFrameRenderingIdleTime && |
| + if (static_cast<size_t>(idle_time_in_ms) > kMaxFrameRenderingIdleTime && |
| (remaining_mark_sweeps <= 2 || |
| !heap_state.can_start_incremental_marking)) { |
| return GCIdleTimeAction::FullGC(); |
| @@ -240,7 +241,7 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms, |
| } |
| // TODO(hpayer): Estimate finalize sweeping time. |
| if (heap_state.sweeping_in_progress && |
| - idle_time_in_ms >= kMinTimeForFinalizeSweeping) { |
| + static_cast<size_t>(idle_time_in_ms) >= kMinTimeForFinalizeSweeping) { |
| return GCIdleTimeAction::FinalizeSweeping(); |
| } |
| @@ -249,7 +250,8 @@ GCIdleTimeAction GCIdleTimeHandler::Compute(size_t idle_time_in_ms, |
| return GCIdleTimeAction::Nothing(); |
| } |
| size_t step_size = EstimateMarkingStepSize( |
| - idle_time_in_ms, heap_state.incremental_marking_speed_in_bytes_per_ms); |
| + static_cast<size_t>(idle_time_in_ms), |
| + heap_state.incremental_marking_speed_in_bytes_per_ms); |
| return GCIdleTimeAction::IncrementalMarking(step_size); |
| } |
| } |