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 1182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1193 // allocation), so to reduce the lumpiness we don't use the write barriers | 1193 // allocation), so to reduce the lumpiness we don't use the write barriers |
1194 // invoked since last step directly to determine the amount of work to do. | 1194 // invoked since last step directly to determine the amount of work to do. |
1195 intptr_t bytes_to_process = | 1195 intptr_t bytes_to_process = |
1196 marking_speed_ * | 1196 marking_speed_ * |
1197 Max(allocated_, write_barriers_invoked_since_last_step_); | 1197 Max(allocated_, write_barriers_invoked_since_last_step_); |
1198 allocated_ = 0; | 1198 allocated_ = 0; |
1199 write_barriers_invoked_since_last_step_ = 0; | 1199 write_barriers_invoked_since_last_step_ = 0; |
1200 | 1200 |
1201 bytes_scanned_ += bytes_to_process; | 1201 bytes_scanned_ += bytes_to_process; |
1202 | 1202 |
1203 // TODO(hpayer): Do not account for sweeping finalization while marking. | |
1204 if (state_ == SWEEPING) { | 1203 if (state_ == SWEEPING) { |
| 1204 TRACE_GC(heap_->tracer(), GCTracer::Scope::MC_INCREMENTAL_SWEEPING); |
1205 FinalizeSweeping(); | 1205 FinalizeSweeping(); |
1206 } | 1206 } |
1207 | 1207 |
1208 if (state_ == MARKING) { | 1208 if (state_ == MARKING) { |
1209 bytes_processed = ProcessMarkingDeque(bytes_to_process); | 1209 bytes_processed = ProcessMarkingDeque(bytes_to_process); |
1210 if (FLAG_incremental_marking_wrappers && | 1210 if (FLAG_incremental_marking_wrappers && |
1211 heap_->UsingEmbedderHeapTracer()) { | 1211 heap_->UsingEmbedderHeapTracer()) { |
1212 TRACE_GC(heap()->tracer(), | 1212 TRACE_GC(heap()->tracer(), |
1213 GCTracer::Scope::MC_INCREMENTAL_WRAPPER_TRACING); | 1213 GCTracer::Scope::MC_INCREMENTAL_WRAPPER_TRACING); |
1214 // This currently marks through all registered wrappers and does not | 1214 // This currently marks through all registered wrappers and does not |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1279 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1279 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
1280 idle_marking_delay_counter_++; | 1280 idle_marking_delay_counter_++; |
1281 } | 1281 } |
1282 | 1282 |
1283 | 1283 |
1284 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1284 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1285 idle_marking_delay_counter_ = 0; | 1285 idle_marking_delay_counter_ = 0; |
1286 } | 1286 } |
1287 } // namespace internal | 1287 } // namespace internal |
1288 } // namespace v8 | 1288 } // namespace v8 |
OLD | NEW |