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 1031 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1042 } | 1042 } |
1043 | 1043 |
1044 double IncrementalMarking::AdvanceIncrementalMarking( | 1044 double IncrementalMarking::AdvanceIncrementalMarking( |
1045 double deadline_in_ms, IncrementalMarking::StepActions step_actions) { | 1045 double deadline_in_ms, IncrementalMarking::StepActions step_actions) { |
1046 DCHECK(!IsStopped()); | 1046 DCHECK(!IsStopped()); |
1047 | 1047 |
1048 intptr_t step_size_in_bytes = GCIdleTimeHandler::EstimateMarkingStepSize( | 1048 intptr_t step_size_in_bytes = GCIdleTimeHandler::EstimateMarkingStepSize( |
1049 GCIdleTimeHandler::kIncrementalMarkingStepTimeInMs, | 1049 GCIdleTimeHandler::kIncrementalMarkingStepTimeInMs, |
1050 heap()->tracer()->IncrementalMarkingSpeedInBytesPerMillisecond()); | 1050 heap()->tracer()->IncrementalMarkingSpeedInBytesPerMillisecond()); |
1051 double remaining_time_in_ms = 0.0; | 1051 double remaining_time_in_ms = 0.0; |
1052 intptr_t bytes_processed = 0; | |
1053 | 1052 |
1054 do { | 1053 do { |
1055 bytes_processed = | 1054 Step(step_size_in_bytes, step_actions.completion_action, |
1056 Step(step_size_in_bytes, step_actions.completion_action, | 1055 step_actions.force_marking, step_actions.force_completion); |
1057 step_actions.force_marking, step_actions.force_completion); | |
1058 remaining_time_in_ms = | 1056 remaining_time_in_ms = |
1059 deadline_in_ms - heap()->MonotonicallyIncreasingTimeInMs(); | 1057 deadline_in_ms - heap()->MonotonicallyIncreasingTimeInMs(); |
1060 } while (!heap_->mark_compact_collector()->marking_deque()->IsEmpty() && | 1058 } while (!heap_->mark_compact_collector()->marking_deque()->IsEmpty() && |
1061 remaining_time_in_ms >= | 1059 remaining_time_in_ms >= |
1062 2.0 * GCIdleTimeHandler::kIncrementalMarkingStepTimeInMs && | 1060 2.0 * GCIdleTimeHandler::kIncrementalMarkingStepTimeInMs && |
1063 !IsComplete() && | 1061 !IsComplete() && |
1064 !heap()->mark_compact_collector()->marking_deque()->IsEmpty()); | 1062 !heap()->mark_compact_collector()->marking_deque()->IsEmpty()); |
1065 return remaining_time_in_ms; | 1063 return remaining_time_in_ms; |
1066 } | 1064 } |
1067 | 1065 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1306 idle_marking_delay_counter_++; | 1304 idle_marking_delay_counter_++; |
1307 } | 1305 } |
1308 | 1306 |
1309 | 1307 |
1310 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1308 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1311 idle_marking_delay_counter_ = 0; | 1309 idle_marking_delay_counter_ = 0; |
1312 } | 1310 } |
1313 | 1311 |
1314 } // namespace internal | 1312 } // namespace internal |
1315 } // namespace v8 | 1313 } // namespace v8 |
OLD | NEW |