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/concurrent-marking.h" | 10 #include "src/heap/concurrent-marking.h" |
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 size_t step_size = Max(initial_old_generation_size_ / kTargetStepCount, | 1096 size_t step_size = Max(initial_old_generation_size_ / kTargetStepCount, |
1097 IncrementalMarking::kAllocatedThreshold); | 1097 IncrementalMarking::kAllocatedThreshold); |
1098 double time_passed_ms = | 1098 double time_passed_ms = |
1099 heap_->MonotonicallyIncreasingTimeInMs() - start_time_ms_; | 1099 heap_->MonotonicallyIncreasingTimeInMs() - start_time_ms_; |
1100 double factor = Min(time_passed_ms / kRampUpIntervalMs, 1.0); | 1100 double factor = Min(time_passed_ms / kRampUpIntervalMs, 1.0); |
1101 return static_cast<size_t>(factor * step_size); | 1101 return static_cast<size_t>(factor * step_size); |
1102 } | 1102 } |
1103 | 1103 |
1104 void IncrementalMarking::AdvanceIncrementalMarkingOnAllocation() { | 1104 void IncrementalMarking::AdvanceIncrementalMarkingOnAllocation() { |
1105 if (heap_->gc_state() != Heap::NOT_IN_GC || !FLAG_incremental_marking || | 1105 if (heap_->gc_state() != Heap::NOT_IN_GC || !FLAG_incremental_marking || |
1106 (state_ != SWEEPING && state_ != MARKING)) { | 1106 (state_ != SWEEPING && state_ != MARKING) || heap_->always_allocate()) { |
1107 return; | 1107 return; |
1108 } | 1108 } |
1109 | 1109 |
1110 size_t bytes_to_process = | 1110 size_t bytes_to_process = |
1111 StepSizeToKeepUpWithAllocations() + StepSizeToMakeProgress(); | 1111 StepSizeToKeepUpWithAllocations() + StepSizeToMakeProgress(); |
1112 | 1112 |
1113 if (bytes_to_process >= IncrementalMarking::kAllocatedThreshold) { | 1113 if (bytes_to_process >= IncrementalMarking::kAllocatedThreshold) { |
1114 // The first step after Scavenge will see many allocated bytes. | 1114 // The first step after Scavenge will see many allocated bytes. |
1115 // Cap the step size to distribute the marking work more uniformly. | 1115 // Cap the step size to distribute the marking work more uniformly. |
1116 size_t max_step_size = GCIdleTimeHandler::EstimateMarkingStepSize( | 1116 size_t max_step_size = GCIdleTimeHandler::EstimateMarkingStepSize( |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1199 idle_marking_delay_counter_++; | 1199 idle_marking_delay_counter_++; |
1200 } | 1200 } |
1201 | 1201 |
1202 | 1202 |
1203 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1203 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1204 idle_marking_delay_counter_ = 0; | 1204 idle_marking_delay_counter_ = 0; |
1205 } | 1205 } |
1206 | 1206 |
1207 } // namespace internal | 1207 } // namespace internal |
1208 } // namespace v8 | 1208 } // namespace v8 |
OLD | NEW |