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 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 "slack %dMB\n", | 508 "slack %dMB\n", |
509 Heap::GarbageCollectionReasonToString(gc_reason), | 509 Heap::GarbageCollectionReasonToString(gc_reason), |
510 old_generation_size_mb, old_generation_limit_mb, | 510 old_generation_size_mb, old_generation_limit_mb, |
511 Max(0, old_generation_limit_mb - old_generation_size_mb)); | 511 Max(0, old_generation_limit_mb - old_generation_size_mb)); |
512 } | 512 } |
513 DCHECK(FLAG_incremental_marking); | 513 DCHECK(FLAG_incremental_marking); |
514 DCHECK(state_ == STOPPED); | 514 DCHECK(state_ == STOPPED); |
515 DCHECK(heap_->gc_state() == Heap::NOT_IN_GC); | 515 DCHECK(heap_->gc_state() == Heap::NOT_IN_GC); |
516 DCHECK(!heap_->isolate()->serializer_enabled()); | 516 DCHECK(!heap_->isolate()->serializer_enabled()); |
517 | 517 |
| 518 Counters* counters = heap_->isolate()->counters(); |
| 519 |
| 520 counters->incremental_marking_reason()->AddSample( |
| 521 static_cast<int>(gc_reason)); |
518 HistogramTimerScope incremental_marking_scope( | 522 HistogramTimerScope incremental_marking_scope( |
519 heap_->isolate()->counters()->gc_incremental_marking_start()); | 523 counters->gc_incremental_marking_start()); |
520 TRACE_EVENT0("v8", "V8.GCIncrementalMarkingStart"); | 524 TRACE_EVENT0("v8", "V8.GCIncrementalMarkingStart"); |
521 ResetStepCounters(); | 525 ResetStepCounters(); |
522 heap_->tracer()->NotifyIncrementalMarkingStart(); | 526 heap_->tracer()->NotifyIncrementalMarkingStart(); |
523 | 527 |
524 was_activated_ = true; | 528 was_activated_ = true; |
525 | 529 |
526 if (!heap_->mark_compact_collector()->sweeping_in_progress()) { | 530 if (!heap_->mark_compact_collector()->sweeping_in_progress()) { |
527 StartMarking(); | 531 StartMarking(); |
528 } else { | 532 } else { |
529 if (FLAG_trace_incremental_marking) { | 533 if (FLAG_trace_incremental_marking) { |
(...skipping 757 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1287 idle_marking_delay_counter_++; | 1291 idle_marking_delay_counter_++; |
1288 } | 1292 } |
1289 | 1293 |
1290 | 1294 |
1291 void IncrementalMarking::ClearIdleMarkingDelayCounter() { | 1295 void IncrementalMarking::ClearIdleMarkingDelayCounter() { |
1292 idle_marking_delay_counter_ = 0; | 1296 idle_marking_delay_counter_ = 0; |
1293 } | 1297 } |
1294 | 1298 |
1295 } // namespace internal | 1299 } // namespace internal |
1296 } // namespace v8 | 1300 } // namespace v8 |
OLD | NEW |