| 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 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 549 void IncrementalMarking::Start(const char* reason) { | 549 void IncrementalMarking::Start(const char* reason) { |
| 550 if (FLAG_trace_incremental_marking) { | 550 if (FLAG_trace_incremental_marking) { |
| 551 PrintF("[IncrementalMarking] Start (%s)\n", | 551 PrintF("[IncrementalMarking] Start (%s)\n", |
| 552 (reason == nullptr) ? "unknown reason" : reason); | 552 (reason == nullptr) ? "unknown reason" : reason); |
| 553 } | 553 } |
| 554 DCHECK(FLAG_incremental_marking); | 554 DCHECK(FLAG_incremental_marking); |
| 555 DCHECK(state_ == STOPPED); | 555 DCHECK(state_ == STOPPED); |
| 556 DCHECK(heap_->gc_state() == Heap::NOT_IN_GC); | 556 DCHECK(heap_->gc_state() == Heap::NOT_IN_GC); |
| 557 DCHECK(!heap_->isolate()->serializer_enabled()); | 557 DCHECK(!heap_->isolate()->serializer_enabled()); |
| 558 | 558 |
| 559 HistogramTimerScope incremental_marking_scope( |
| 560 heap_->isolate()->counters()->gc_incremental_marking_start()); |
| 559 ResetStepCounters(); | 561 ResetStepCounters(); |
| 560 | 562 |
| 561 was_activated_ = true; | 563 was_activated_ = true; |
| 562 | 564 |
| 563 if (!heap_->mark_compact_collector()->sweeping_in_progress()) { | 565 if (!heap_->mark_compact_collector()->sweeping_in_progress()) { |
| 564 StartMarking(); | 566 StartMarking(); |
| 565 } else { | 567 } else { |
| 566 if (FLAG_trace_incremental_marking) { | 568 if (FLAG_trace_incremental_marking) { |
| 567 PrintF("[IncrementalMarking] Start sweeping.\n"); | 569 PrintF("[IncrementalMarking] Start sweeping.\n"); |
| 568 } | 570 } |
| (...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { | 1154 void IncrementalMarking::IncrementIdleMarkingDelayCounter() { |
| 1153 idle_marking_delay_counter_++; | 1155 idle_marking_delay_counter_++; |
| 1154 } | 1156 } |
| 1155 | 1157 |
| 1156 | 1158 |
| 1157 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1159 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
| 1158 idle_marking_delay_counter_ = 0; | 1160 idle_marking_delay_counter_ = 0; |
| 1159 } | 1161 } |
| 1160 } // namespace internal | 1162 } // namespace internal |
| 1161 } // namespace v8 | 1163 } // namespace v8 |
| OLD | NEW |