| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/gc-tracer.h" | 5 #include "src/heap/gc-tracer.h" |
| 6 | 6 |
| 7 #include "src/counters.h" | 7 #include "src/counters.h" |
| 8 #include "src/heap/heap-inl.h" | 8 #include "src/heap/heap-inl.h" |
| 9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
| 10 | 10 |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 469 | 469 |
| 470 | 470 |
| 471 void GCTracer::PrintNVP() const { | 471 void GCTracer::PrintNVP() const { |
| 472 double duration = current_.end_time - current_.start_time; | 472 double duration = current_.end_time - current_.start_time; |
| 473 double spent_in_mutator = current_.start_time - previous_.end_time; | 473 double spent_in_mutator = current_.start_time - previous_.end_time; |
| 474 intptr_t allocated_since_last_gc = | 474 intptr_t allocated_since_last_gc = |
| 475 current_.start_object_size - previous_.end_object_size; | 475 current_.start_object_size - previous_.end_object_size; |
| 476 | 476 |
| 477 switch (current_.type) { | 477 switch (current_.type) { |
| 478 case Event::SCAVENGER: | 478 case Event::SCAVENGER: |
| 479 PrintIsolate(heap_->isolate(), | 479 PrintIsolate( |
| 480 "%8.0f ms: " | 480 heap_->isolate(), |
| 481 "pause=%.1f " | 481 "%8.0f ms: " |
| 482 "mutator=%.1f " | 482 "pause=%.1f " |
| 483 "gc=%s " | 483 "mutator=%.1f " |
| 484 "reduce_memory=%d " | 484 "gc=%s " |
| 485 "scavenge=%.2f " | 485 "reduce_memory=%d " |
| 486 "old_new=%.2f " | 486 "scavenge=%.2f " |
| 487 "weak=%.2f " | 487 "revive_marked_objects=%.2f " |
| 488 "roots=%.2f " | 488 "old_new=%.2f " |
| 489 "code=%.2f " | 489 "weak=%.2f " |
| 490 "semispace=%.2f " | 490 "roots=%.2f " |
| 491 "object_groups=%.2f " | 491 "code=%.2f " |
| 492 "external_prologue=%.2f " | 492 "semispace=%.2f " |
| 493 "external_epilogue=%.2f " | 493 "object_groups=%.2f " |
| 494 "external_weak_global_handles=%.2f " | 494 "external_prologue=%.2f " |
| 495 "steps_count=%d " | 495 "external_epilogue=%.2f " |
| 496 "steps_took=%.1f " | 496 "external_weak_global_handles=%.2f " |
| 497 "scavenge_throughput=%.f " | 497 "steps_count=%d " |
| 498 "total_size_before=%" V8PRIdPTR | 498 "steps_took=%.1f " |
| 499 " " | 499 "scavenge_throughput=%.f " |
| 500 "total_size_after=%" V8PRIdPTR | 500 "total_size_before=%" V8PRIdPTR |
| 501 " " | 501 " " |
| 502 "holes_size_before=%" V8PRIdPTR | 502 "total_size_after=%" V8PRIdPTR |
| 503 " " | 503 " " |
| 504 "holes_size_after=%" V8PRIdPTR | 504 "holes_size_before=%" V8PRIdPTR |
| 505 " " | 505 " " |
| 506 "allocated=%" V8PRIdPTR | 506 "holes_size_after=%" V8PRIdPTR |
| 507 " " | 507 " " |
| 508 "promoted=%" V8PRIdPTR | 508 "allocated=%" V8PRIdPTR |
| 509 " " | 509 " " |
| 510 "semi_space_copied=%" V8PRIdPTR | 510 "promoted=%" V8PRIdPTR |
| 511 " " | 511 " " |
| 512 "nodes_died_in_new=%d " | 512 "semi_space_copied=%" V8PRIdPTR |
| 513 "nodes_copied_in_new=%d " | 513 " " |
| 514 "nodes_promoted=%d " | 514 "nodes_died_in_new=%d " |
| 515 "promotion_ratio=%.1f%% " | 515 "nodes_copied_in_new=%d " |
| 516 "average_survival_ratio=%.1f%% " | 516 "nodes_promoted=%d " |
| 517 "promotion_rate=%.1f%% " | 517 "promotion_ratio=%.1f%% " |
| 518 "semi_space_copy_rate=%.1f%% " | 518 "average_survival_ratio=%.1f%% " |
| 519 "new_space_allocation_throughput=%.1f " | 519 "promotion_rate=%.1f%% " |
| 520 "context_disposal_rate=%.1f\n", | 520 "semi_space_copy_rate=%.1f%% " |
| 521 heap_->isolate()->time_millis_since_init(), duration, | 521 "new_space_allocation_throughput=%.1f " |
| 522 spent_in_mutator, current_.TypeName(true), | 522 "context_disposal_rate=%.1f\n", |
| 523 current_.reduce_memory, | 523 heap_->isolate()->time_millis_since_init(), duration, |
| 524 current_.scopes[Scope::SCAVENGER_SCAVENGE], | 524 spent_in_mutator, current_.TypeName(true), current_.reduce_memory, |
| 525 current_.scopes[Scope::SCAVENGER_OLD_TO_NEW_POINTERS], | 525 current_.scopes[Scope::SCAVENGER_SCAVENGE], |
| 526 current_.scopes[Scope::SCAVENGER_WEAK], | 526 current_.scopes[Scope::SCAVENGER_OBJECTS_MARKED_BY_MARK_COMPACT], |
| 527 current_.scopes[Scope::SCAVENGER_ROOTS], | 527 current_.scopes[Scope::SCAVENGER_OLD_TO_NEW_POINTERS], |
| 528 current_.scopes[Scope::SCAVENGER_CODE_FLUSH_CANDIDATES], | 528 current_.scopes[Scope::SCAVENGER_WEAK], |
| 529 current_.scopes[Scope::SCAVENGER_SEMISPACE], | 529 current_.scopes[Scope::SCAVENGER_ROOTS], |
| 530 current_.scopes[Scope::SCAVENGER_OBJECT_GROUPS], | 530 current_.scopes[Scope::SCAVENGER_CODE_FLUSH_CANDIDATES], |
| 531 current_.scopes[Scope::SCAVENGER_EXTERNAL_PROLOGUE], | 531 current_.scopes[Scope::SCAVENGER_SEMISPACE], |
| 532 current_.scopes[Scope::SCAVENGER_EXTERNAL_EPILOGUE], | 532 current_.scopes[Scope::SCAVENGER_OBJECT_GROUPS], |
| 533 current_.scopes[Scope::EXTERNAL_WEAK_GLOBAL_HANDLES], | 533 current_.scopes[Scope::SCAVENGER_EXTERNAL_PROLOGUE], |
| 534 current_.incremental_marking_steps, | 534 current_.scopes[Scope::SCAVENGER_EXTERNAL_EPILOGUE], |
| 535 current_.incremental_marking_duration, | 535 current_.scopes[Scope::EXTERNAL_WEAK_GLOBAL_HANDLES], |
| 536 ScavengeSpeedInBytesPerMillisecond(), | 536 current_.incremental_marking_steps, |
| 537 current_.start_object_size, current_.end_object_size, | 537 current_.incremental_marking_duration, |
| 538 current_.start_holes_size, current_.end_holes_size, | 538 ScavengeSpeedInBytesPerMillisecond(), current_.start_object_size, |
| 539 allocated_since_last_gc, heap_->promoted_objects_size(), | 539 current_.end_object_size, current_.start_holes_size, |
| 540 heap_->semi_space_copied_object_size(), | 540 current_.end_holes_size, allocated_since_last_gc, |
| 541 heap_->nodes_died_in_new_space_, | 541 heap_->promoted_objects_size(), |
| 542 heap_->nodes_copied_in_new_space_, heap_->nodes_promoted_, | 542 heap_->semi_space_copied_object_size(), |
| 543 heap_->promotion_ratio_, AverageSurvivalRatio(), | 543 heap_->nodes_died_in_new_space_, heap_->nodes_copied_in_new_space_, |
| 544 heap_->promotion_rate_, heap_->semi_space_copied_rate_, | 544 heap_->nodes_promoted_, heap_->promotion_ratio_, |
| 545 NewSpaceAllocationThroughputInBytesPerMillisecond(), | 545 AverageSurvivalRatio(), heap_->promotion_rate_, |
| 546 ContextDisposalRateInMilliseconds()); | 546 heap_->semi_space_copied_rate_, |
| 547 NewSpaceAllocationThroughputInBytesPerMillisecond(), |
| 548 ContextDisposalRateInMilliseconds()); |
| 547 break; | 549 break; |
| 548 case Event::MARK_COMPACTOR: | 550 case Event::MARK_COMPACTOR: |
| 549 case Event::INCREMENTAL_MARK_COMPACTOR: | 551 case Event::INCREMENTAL_MARK_COMPACTOR: |
| 550 PrintIsolate( | 552 PrintIsolate( |
| 551 heap_->isolate(), | 553 heap_->isolate(), |
| 552 "%8.0f ms: " | 554 "%8.0f ms: " |
| 553 "pause=%.1f " | 555 "pause=%.1f " |
| 554 "mutator=%.1f " | 556 "mutator=%.1f " |
| 555 "gc=%s " | 557 "gc=%s " |
| 556 "reduce_memory=%d " | 558 "reduce_memory=%d " |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 813 return sum / recorded_survival_ratios_.Count(); | 815 return sum / recorded_survival_ratios_.Count(); |
| 814 } | 816 } |
| 815 | 817 |
| 816 bool GCTracer::SurvivalEventsRecorded() const { | 818 bool GCTracer::SurvivalEventsRecorded() const { |
| 817 return recorded_survival_ratios_.Count() > 0; | 819 return recorded_survival_ratios_.Count() > 0; |
| 818 } | 820 } |
| 819 | 821 |
| 820 void GCTracer::ResetSurvivalEvents() { recorded_survival_ratios_.Reset(); } | 822 void GCTracer::ResetSurvivalEvents() { recorded_survival_ratios_.Reset(); } |
| 821 } // namespace internal | 823 } // namespace internal |
| 822 } // namespace v8 | 824 } // namespace v8 |
| OLD | NEW |