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 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 } | 1017 } |
1018 | 1018 |
1019 | 1019 |
1020 double IncrementalMarking::AdvanceIncrementalMarking( | 1020 double IncrementalMarking::AdvanceIncrementalMarking( |
1021 intptr_t step_size_in_bytes, double deadline_in_ms, | 1021 intptr_t step_size_in_bytes, double deadline_in_ms, |
1022 IncrementalMarking::StepActions step_actions) { | 1022 IncrementalMarking::StepActions step_actions) { |
1023 DCHECK(!IsStopped()); | 1023 DCHECK(!IsStopped()); |
1024 | 1024 |
1025 if (step_size_in_bytes == 0) { | 1025 if (step_size_in_bytes == 0) { |
1026 step_size_in_bytes = GCIdleTimeHandler::EstimateMarkingStepSize( | 1026 step_size_in_bytes = GCIdleTimeHandler::EstimateMarkingStepSize( |
1027 static_cast<size_t>(GCIdleTimeHandler::kIncrementalMarkingStepTimeInMs), | 1027 GCIdleTimeHandler::kIncrementalMarkingStepTimeInMs, |
1028 static_cast<size_t>( | 1028 heap() |
1029 heap() | 1029 ->tracer() |
1030 ->tracer() | 1030 ->FinalIncrementalMarkCompactSpeedInBytesPerMillisecond()); |
1031 ->FinalIncrementalMarkCompactSpeedInBytesPerMillisecond())); | |
1032 } | 1031 } |
1033 | 1032 |
1034 double remaining_time_in_ms = 0.0; | 1033 double remaining_time_in_ms = 0.0; |
1035 do { | 1034 do { |
1036 Step(step_size_in_bytes, step_actions.completion_action, | 1035 Step(step_size_in_bytes, step_actions.completion_action, |
1037 step_actions.force_marking, step_actions.force_completion); | 1036 step_actions.force_marking, step_actions.force_completion); |
1038 remaining_time_in_ms = | 1037 remaining_time_in_ms = |
1039 deadline_in_ms - heap()->MonotonicallyIncreasingTimeInMs(); | 1038 deadline_in_ms - heap()->MonotonicallyIncreasingTimeInMs(); |
1040 } while (remaining_time_in_ms >= | 1039 } while (remaining_time_in_ms >= |
1041 2.0 * GCIdleTimeHandler::kIncrementalMarkingStepTimeInMs && | 1040 2.0 * GCIdleTimeHandler::kIncrementalMarkingStepTimeInMs && |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1245 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
1247 idle_marking_delay_counter_++; | 1246 idle_marking_delay_counter_++; |
1248 } | 1247 } |
1249 | 1248 |
1250 | 1249 |
1251 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1250 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1252 idle_marking_delay_counter_ = 0; | 1251 idle_marking_delay_counter_ = 0; |
1253 } | 1252 } |
1254 } // namespace internal | 1253 } // namespace internal |
1255 } // namespace v8 | 1254 } // namespace v8 |
OLD | NEW |