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 997 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1008 } | 1008 } |
1009 } | 1009 } |
1010 | 1010 |
1011 | 1011 |
1012 void IncrementalMarking::Epilogue() { | 1012 void IncrementalMarking::Epilogue() { |
1013 was_activated_ = false; | 1013 was_activated_ = false; |
1014 finalize_marking_completed_ = false; | 1014 finalize_marking_completed_ = false; |
1015 incremental_marking_finalization_rounds_ = 0; | 1015 incremental_marking_finalization_rounds_ = 0; |
1016 } | 1016 } |
1017 | 1017 |
1018 | |
1019 double IncrementalMarking::AdvanceIncrementalMarking( | 1018 double IncrementalMarking::AdvanceIncrementalMarking( |
1020 intptr_t step_size_in_bytes, double deadline_in_ms, | 1019 double deadline_in_ms, IncrementalMarking::StepActions step_actions) { |
1021 IncrementalMarking::StepActions step_actions) { | |
1022 DCHECK(!IsStopped()); | 1020 DCHECK(!IsStopped()); |
1023 | 1021 |
1024 if (step_size_in_bytes == 0) { | 1022 intptr_t step_size_in_bytes = GCIdleTimeHandler::EstimateMarkingStepSize( |
1025 step_size_in_bytes = GCIdleTimeHandler::EstimateMarkingStepSize( | 1023 GCIdleTimeHandler::kIncrementalMarkingStepTimeInMs, |
1026 GCIdleTimeHandler::kIncrementalMarkingStepTimeInMs, | 1024 heap() |
1027 heap() | 1025 ->tracer() |
1028 ->tracer() | 1026 ->FinalIncrementalMarkCompactSpeedInBytesPerMillisecond()); |
1029 ->FinalIncrementalMarkCompactSpeedInBytesPerMillisecond()); | |
1030 } | |
1031 | |
1032 double remaining_time_in_ms = 0.0; | 1027 double remaining_time_in_ms = 0.0; |
1033 intptr_t bytes_processed = 0; | 1028 intptr_t bytes_processed = 0; |
| 1029 |
1034 do { | 1030 do { |
1035 bytes_processed = | 1031 bytes_processed = |
1036 Step(step_size_in_bytes, step_actions.completion_action, | 1032 Step(step_size_in_bytes, step_actions.completion_action, |
1037 step_actions.force_marking, step_actions.force_completion); | 1033 step_actions.force_marking, step_actions.force_completion); |
1038 remaining_time_in_ms = | 1034 remaining_time_in_ms = |
1039 deadline_in_ms - heap()->MonotonicallyIncreasingTimeInMs(); | 1035 deadline_in_ms - heap()->MonotonicallyIncreasingTimeInMs(); |
1040 } while (bytes_processed > 0 && | 1036 } while (bytes_processed > 0 && |
1041 remaining_time_in_ms >= | 1037 remaining_time_in_ms >= |
1042 2.0 * GCIdleTimeHandler::kIncrementalMarkingStepTimeInMs && | 1038 2.0 * GCIdleTimeHandler::kIncrementalMarkingStepTimeInMs && |
1043 !IsComplete() && | 1039 !IsComplete() && |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1246 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1242 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
1247 idle_marking_delay_counter_++; | 1243 idle_marking_delay_counter_++; |
1248 } | 1244 } |
1249 | 1245 |
1250 | 1246 |
1251 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1247 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1252 idle_marking_delay_counter_ = 0; | 1248 idle_marking_delay_counter_ = 0; |
1253 } | 1249 } |
1254 } // namespace internal | 1250 } // namespace internal |
1255 } // namespace v8 | 1251 } // namespace v8 |
OLD | NEW |