Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "src/heap/incremental-marking.h" | 5 #include "src/heap/incremental-marking.h" |
| 6 | 6 |
| 7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/compilation-cache.h" | 8 #include "src/compilation-cache.h" |
| 9 #include "src/conversions.h" | 9 #include "src/conversions.h" |
| 10 #include "src/heap/gc-idle-time-handler.h" | 10 #include "src/heap/gc-idle-time-handler.h" |
| (...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1031 double remaining_time_in_ms = 0.0; | 1031 double remaining_time_in_ms = 0.0; |
| 1032 intptr_t step_size_in_bytes = GCIdleTimeHandler::EstimateMarkingStepSize( | 1032 intptr_t step_size_in_bytes = GCIdleTimeHandler::EstimateMarkingStepSize( |
| 1033 kStepSizeInMs, | 1033 kStepSizeInMs, |
| 1034 heap()->tracer()->IncrementalMarkingSpeedInBytesPerMillisecond()); | 1034 heap()->tracer()->IncrementalMarkingSpeedInBytesPerMillisecond()); |
| 1035 | 1035 |
| 1036 do { | 1036 do { |
| 1037 Step(step_size_in_bytes, completion_action, force_completion, step_origin); | 1037 Step(step_size_in_bytes, completion_action, force_completion, step_origin); |
| 1038 remaining_time_in_ms = | 1038 remaining_time_in_ms = |
| 1039 deadline_in_ms - heap()->MonotonicallyIncreasingTimeInMs(); | 1039 deadline_in_ms - heap()->MonotonicallyIncreasingTimeInMs(); |
| 1040 } while (remaining_time_in_ms >= kStepSizeInMs && !IsComplete() && | 1040 } while (remaining_time_in_ms >= kStepSizeInMs && !IsComplete() && |
| 1041 !heap()->mark_compact_collector()->marking_deque()->IsEmpty()); | 1041 !heap()->MarkingDequesAreEmpty()); |
|
ulan
2016/12/05 21:18:16
Michael: do you approve this change?
| |
| 1042 return remaining_time_in_ms; | 1042 return remaining_time_in_ms; |
| 1043 } | 1043 } |
| 1044 | 1044 |
| 1045 | 1045 |
| 1046 void IncrementalMarking::FinalizeSweeping() { | 1046 void IncrementalMarking::FinalizeSweeping() { |
| 1047 DCHECK(state_ == SWEEPING); | 1047 DCHECK(state_ == SWEEPING); |
| 1048 if (heap_->mark_compact_collector()->sweeping_in_progress() && | 1048 if (heap_->mark_compact_collector()->sweeping_in_progress() && |
| 1049 (!FLAG_concurrent_sweeping || | 1049 (!FLAG_concurrent_sweeping || |
| 1050 !heap_->mark_compact_collector()->sweeper().AreSweeperTasksRunning())) { | 1050 !heap_->mark_compact_collector()->sweeper().AreSweeperTasksRunning())) { |
| 1051 heap_->mark_compact_collector()->EnsureSweepingCompleted(); | 1051 heap_->mark_compact_collector()->EnsureSweepingCompleted(); |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1197 idle_marking_delay_counter_++; | 1197 idle_marking_delay_counter_++; |
| 1198 } | 1198 } |
| 1199 | 1199 |
| 1200 | 1200 |
| 1201 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1201 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
| 1202 idle_marking_delay_counter_ = 0; | 1202 idle_marking_delay_counter_ = 0; |
| 1203 } | 1203 } |
| 1204 | 1204 |
| 1205 } // namespace internal | 1205 } // namespace internal |
| 1206 } // namespace v8 | 1206 } // namespace v8 |
| OLD | NEW |