| 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 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 387 PrintIsolate(heap_->isolate(), ""); | 387 PrintIsolate(heap_->isolate(), ""); |
| 388 } | 388 } |
| 389 Output("%8.0f ms: ", heap_->isolate()->time_millis_since_init()); | 389 Output("%8.0f ms: ", heap_->isolate()->time_millis_since_init()); |
| 390 | 390 |
| 391 Output("%s %.1f (%.1f) -> %.1f (%.1f) MB, ", current_.TypeName(false), | 391 Output("%s %.1f (%.1f) -> %.1f (%.1f) MB, ", current_.TypeName(false), |
| 392 static_cast<double>(current_.start_object_size) / MB, | 392 static_cast<double>(current_.start_object_size) / MB, |
| 393 static_cast<double>(current_.start_memory_size) / MB, | 393 static_cast<double>(current_.start_memory_size) / MB, |
| 394 static_cast<double>(current_.end_object_size) / MB, | 394 static_cast<double>(current_.end_object_size) / MB, |
| 395 static_cast<double>(current_.end_memory_size) / MB); | 395 static_cast<double>(current_.end_memory_size) / MB); |
| 396 | 396 |
| 397 int external_time = static_cast<int>(current_.scopes[Scope::EXTERNAL]); | |
| 398 double duration = current_.end_time - current_.start_time; | 397 double duration = current_.end_time - current_.start_time; |
| 399 Output("%.1f / %d ms", duration, external_time); | 398 Output("%.1f / %.1f ms", duration, TotalExternalTime()); |
| 400 | 399 |
| 401 if (current_.type == Event::SCAVENGER) { | 400 if (current_.type == Event::SCAVENGER) { |
| 402 if (current_.incremental_marking_steps > 0) { | 401 if (current_.incremental_marking_steps > 0) { |
| 403 Output(" (+ %.1f ms in %d steps since last GC)", | 402 Output(" (+ %.1f ms in %d steps since last GC)", |
| 404 current_.incremental_marking_duration, | 403 current_.incremental_marking_duration, |
| 405 current_.incremental_marking_steps); | 404 current_.incremental_marking_steps); |
| 406 } | 405 } |
| 407 } else { | 406 } else { |
| 408 if (current_.incremental_marking_steps > 0) { | 407 if (current_.incremental_marking_steps > 0) { |
| 409 Output( | 408 Output( |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 "mutator=%.1f " | 440 "mutator=%.1f " |
| 442 "gc=%s " | 441 "gc=%s " |
| 443 "reduce_memory=%d " | 442 "reduce_memory=%d " |
| 444 "scavenge=%.2f " | 443 "scavenge=%.2f " |
| 445 "old_new=%.2f " | 444 "old_new=%.2f " |
| 446 "weak=%.2f " | 445 "weak=%.2f " |
| 447 "roots=%.2f " | 446 "roots=%.2f " |
| 448 "code=%.2f " | 447 "code=%.2f " |
| 449 "semispace=%.2f " | 448 "semispace=%.2f " |
| 450 "object_groups=%.2f " | 449 "object_groups=%.2f " |
| 450 "external_prologue=$.2f " |
| 451 "external_epilogue=$.2f " |
| 452 "external_weak_global_handles=$.2f " |
| 451 "steps_count=%d " | 453 "steps_count=%d " |
| 452 "steps_took=%.1f " | 454 "steps_took=%.1f " |
| 453 "scavenge_throughput=%" V8_PTR_PREFIX | 455 "scavenge_throughput=%" V8_PTR_PREFIX |
| 454 "d " | 456 "d " |
| 455 "total_size_before=%" V8_PTR_PREFIX | 457 "total_size_before=%" V8_PTR_PREFIX |
| 456 "d " | 458 "d " |
| 457 "total_size_after=%" V8_PTR_PREFIX | 459 "total_size_after=%" V8_PTR_PREFIX |
| 458 "d " | 460 "d " |
| 459 "holes_size_before=%" V8_PTR_PREFIX | 461 "holes_size_before=%" V8_PTR_PREFIX |
| 460 "d " | 462 "d " |
| (...skipping 18 matching lines...) Expand all Loading... |
| 479 heap_->isolate()->time_millis_since_init(), duration, | 481 heap_->isolate()->time_millis_since_init(), duration, |
| 480 spent_in_mutator, current_.TypeName(true), | 482 spent_in_mutator, current_.TypeName(true), |
| 481 current_.reduce_memory, | 483 current_.reduce_memory, |
| 482 current_.scopes[Scope::SCAVENGER_SCAVENGE], | 484 current_.scopes[Scope::SCAVENGER_SCAVENGE], |
| 483 current_.scopes[Scope::SCAVENGER_OLD_TO_NEW_POINTERS], | 485 current_.scopes[Scope::SCAVENGER_OLD_TO_NEW_POINTERS], |
| 484 current_.scopes[Scope::SCAVENGER_WEAK], | 486 current_.scopes[Scope::SCAVENGER_WEAK], |
| 485 current_.scopes[Scope::SCAVENGER_ROOTS], | 487 current_.scopes[Scope::SCAVENGER_ROOTS], |
| 486 current_.scopes[Scope::SCAVENGER_CODE_FLUSH_CANDIDATES], | 488 current_.scopes[Scope::SCAVENGER_CODE_FLUSH_CANDIDATES], |
| 487 current_.scopes[Scope::SCAVENGER_SEMISPACE], | 489 current_.scopes[Scope::SCAVENGER_SEMISPACE], |
| 488 current_.scopes[Scope::SCAVENGER_OBJECT_GROUPS], | 490 current_.scopes[Scope::SCAVENGER_OBJECT_GROUPS], |
| 491 current_.scopes[Scope::SCAVENGER_EXTERNAL_PROLOGUE], |
| 492 current_.scopes[Scope::SCAVENGER_EXTERNAL_EPILOGUE], |
| 493 current_.scopes[Scope::EXTERNAL_WEAK_GLOBAL_HANDLES], |
| 489 current_.incremental_marking_steps, | 494 current_.incremental_marking_steps, |
| 490 current_.incremental_marking_duration, | 495 current_.incremental_marking_duration, |
| 491 ScavengeSpeedInBytesPerMillisecond(), | 496 ScavengeSpeedInBytesPerMillisecond(), |
| 492 current_.start_object_size, current_.end_object_size, | 497 current_.start_object_size, current_.end_object_size, |
| 493 current_.start_holes_size, current_.end_holes_size, | 498 current_.start_holes_size, current_.end_holes_size, |
| 494 allocated_since_last_gc, heap_->promoted_objects_size(), | 499 allocated_since_last_gc, heap_->promoted_objects_size(), |
| 495 heap_->semi_space_copied_object_size(), | 500 heap_->semi_space_copied_object_size(), |
| 496 heap_->nodes_died_in_new_space_, | 501 heap_->nodes_died_in_new_space_, |
| 497 heap_->nodes_copied_in_new_space_, heap_->nodes_promoted_, | 502 heap_->nodes_copied_in_new_space_, heap_->nodes_promoted_, |
| 498 heap_->promotion_ratio_, AverageSurvivalRatio(), | 503 heap_->promotion_ratio_, AverageSurvivalRatio(), |
| 499 heap_->promotion_rate_, heap_->semi_space_copied_rate_, | 504 heap_->promotion_rate_, heap_->semi_space_copied_rate_, |
| 500 NewSpaceAllocationThroughputInBytesPerMillisecond(), | 505 NewSpaceAllocationThroughputInBytesPerMillisecond(), |
| 501 ContextDisposalRateInMilliseconds()); | 506 ContextDisposalRateInMilliseconds()); |
| 502 break; | 507 break; |
| 503 case Event::MARK_COMPACTOR: | 508 case Event::MARK_COMPACTOR: |
| 504 case Event::INCREMENTAL_MARK_COMPACTOR: | 509 case Event::INCREMENTAL_MARK_COMPACTOR: |
| 505 PrintIsolate( | 510 PrintIsolate( |
| 506 heap_->isolate(), | 511 heap_->isolate(), |
| 507 "%8.0f ms: " | 512 "%8.0f ms: " |
| 508 "pause=%.1f " | 513 "pause=%.1f " |
| 509 "mutator=%.1f " | 514 "mutator=%.1f " |
| 510 "gc=%s " | 515 "gc=%s " |
| 511 "reduce_memory=%d " | 516 "reduce_memory=%d " |
| 512 "external=%.1f " | |
| 513 "clear=%1.f " | 517 "clear=%1.f " |
| 514 "clear.code_flush=%.1f " | 518 "clear.code_flush=%.1f " |
| 515 "clear.dependent_code=%.1f " | 519 "clear.dependent_code=%.1f " |
| 516 "clear.global_handles=%.1f " | 520 "clear.global_handles=%.1f " |
| 517 "clear.maps=%.1f " | 521 "clear.maps=%.1f " |
| 518 "clear.slots_buffer=%.1f " | 522 "clear.slots_buffer=%.1f " |
| 519 "clear.store_buffer=%.1f " | 523 "clear.store_buffer=%.1f " |
| 520 "clear.string_table=%.1f " | 524 "clear.string_table=%.1f " |
| 521 "clear.weak_cells=%.1f " | 525 "clear.weak_cells=%.1f " |
| 522 "clear.weak_collections=%.1f " | 526 "clear.weak_collections=%.1f " |
| 523 "clear.weak_lists=%.1f " | 527 "clear.weak_lists=%.1f " |
| 524 "evacuate=%.1f " | 528 "evacuate=%.1f " |
| 525 "evacuate.candidates=%.1f " | 529 "evacuate.candidates=%.1f " |
| 526 "evacuate.clean_up=%.1f " | 530 "evacuate.clean_up=%.1f " |
| 527 "evacuate.copy=%.1f " | 531 "evacuate.copy=%.1f " |
| 528 "evacuate.update_pointers=%.1f " | 532 "evacuate.update_pointers=%.1f " |
| 529 "evacuate.update_pointers.between_evacuated=%.1f " | 533 "evacuate.update_pointers.between_evacuated=%.1f " |
| 530 "evacuate.update_pointers.to_evacuated=%.1f " | 534 "evacuate.update_pointers.to_evacuated=%.1f " |
| 531 "evacuate.update_pointers.to_new=%.1f " | 535 "evacuate.update_pointers.to_new=%.1f " |
| 532 "evacuate.update_pointers.weak=%.1f " | 536 "evacuate.update_pointers.weak=%.1f " |
| 537 "external.mc_prologue=%.1f " |
| 538 "external.mc_epilogue=%.1f " |
| 539 "external.mc_incremental_prologue=%.1f " |
| 540 "external.mc_incremental_epilogue=%.1f " |
| 541 "external.weak_global_handles=%.1f " |
| 533 "finish=%.1f " | 542 "finish=%.1f " |
| 534 "mark=%.1f " | 543 "mark=%.1f " |
| 535 "mark.finish_incremental=%.1f " | 544 "mark.finish_incremental=%.1f " |
| 536 "mark.prepare_code_flush=%.1f " | 545 "mark.prepare_code_flush=%.1f " |
| 537 "mark.roots=%.1f " | 546 "mark.roots=%.1f " |
| 538 "mark.weak_closure=%.1f " | 547 "mark.weak_closure=%.1f " |
| 539 "sweep=%.1f " | 548 "sweep=%.1f " |
| 540 "sweep.code=%.1f " | 549 "sweep.code=%.1f " |
| 541 "sweep.map=%.1f " | 550 "sweep.map=%.1f " |
| 542 "sweep.old=%.1f " | 551 "sweep.old=%.1f " |
| (...skipping 26 matching lines...) Expand all Loading... |
| 569 "promotion_ratio=%.1f%% " | 578 "promotion_ratio=%.1f%% " |
| 570 "average_survival_ratio=%.1f%% " | 579 "average_survival_ratio=%.1f%% " |
| 571 "promotion_rate=%.1f%% " | 580 "promotion_rate=%.1f%% " |
| 572 "semi_space_copy_rate=%.1f%% " | 581 "semi_space_copy_rate=%.1f%% " |
| 573 "new_space_allocation_throughput=%" V8_PTR_PREFIX | 582 "new_space_allocation_throughput=%" V8_PTR_PREFIX |
| 574 "d " | 583 "d " |
| 575 "context_disposal_rate=%.1f " | 584 "context_disposal_rate=%.1f " |
| 576 "compaction_speed=%" V8_PTR_PREFIX "d\n", | 585 "compaction_speed=%" V8_PTR_PREFIX "d\n", |
| 577 heap_->isolate()->time_millis_since_init(), duration, | 586 heap_->isolate()->time_millis_since_init(), duration, |
| 578 spent_in_mutator, current_.TypeName(true), current_.reduce_memory, | 587 spent_in_mutator, current_.TypeName(true), current_.reduce_memory, |
| 579 current_.scopes[Scope::EXTERNAL], current_.scopes[Scope::MC_CLEAR], | 588 current_.scopes[Scope::MC_CLEAR], |
| 580 current_.scopes[Scope::MC_CLEAR_CODE_FLUSH], | 589 current_.scopes[Scope::MC_CLEAR_CODE_FLUSH], |
| 581 current_.scopes[Scope::MC_CLEAR_DEPENDENT_CODE], | 590 current_.scopes[Scope::MC_CLEAR_DEPENDENT_CODE], |
| 582 current_.scopes[Scope::MC_CLEAR_GLOBAL_HANDLES], | 591 current_.scopes[Scope::MC_CLEAR_GLOBAL_HANDLES], |
| 583 current_.scopes[Scope::MC_CLEAR_MAPS], | 592 current_.scopes[Scope::MC_CLEAR_MAPS], |
| 584 current_.scopes[Scope::MC_CLEAR_SLOTS_BUFFER], | 593 current_.scopes[Scope::MC_CLEAR_SLOTS_BUFFER], |
| 585 current_.scopes[Scope::MC_CLEAR_STORE_BUFFER], | 594 current_.scopes[Scope::MC_CLEAR_STORE_BUFFER], |
| 586 current_.scopes[Scope::MC_CLEAR_STRING_TABLE], | 595 current_.scopes[Scope::MC_CLEAR_STRING_TABLE], |
| 587 current_.scopes[Scope::MC_CLEAR_WEAK_CELLS], | 596 current_.scopes[Scope::MC_CLEAR_WEAK_CELLS], |
| 588 current_.scopes[Scope::MC_CLEAR_WEAK_COLLECTIONS], | 597 current_.scopes[Scope::MC_CLEAR_WEAK_COLLECTIONS], |
| 589 current_.scopes[Scope::MC_CLEAR_WEAK_LISTS], | 598 current_.scopes[Scope::MC_CLEAR_WEAK_LISTS], |
| 590 current_.scopes[Scope::MC_EVACUATE], | 599 current_.scopes[Scope::MC_EVACUATE], |
| 591 current_.scopes[Scope::MC_EVACUATE_CANDIDATES], | 600 current_.scopes[Scope::MC_EVACUATE_CANDIDATES], |
| 592 current_.scopes[Scope::MC_EVACUATE_CLEAN_UP], | 601 current_.scopes[Scope::MC_EVACUATE_CLEAN_UP], |
| 593 current_.scopes[Scope::MC_EVACUATE_COPY], | 602 current_.scopes[Scope::MC_EVACUATE_COPY], |
| 594 current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS], | 603 current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS], |
| 595 current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_BETWEEN_EVACUATED], | 604 current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_BETWEEN_EVACUATED], |
| 596 current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_TO_EVACUATED], | 605 current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_TO_EVACUATED], |
| 597 current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_TO_NEW], | 606 current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_TO_NEW], |
| 598 current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_WEAK], | 607 current_.scopes[Scope::MC_EVACUATE_UPDATE_POINTERS_WEAK], |
| 608 current_.scopes[Scope::MC_EXTERNAL_PROLOGUE], |
| 609 current_.scopes[Scope::MC_EXTERNAL_EPILOGUE], |
| 610 current_.scopes[Scope::MC_INCREMENTAL_EXTERNAL_PROLOGUE], |
| 611 current_.scopes[Scope::MC_INCREMENTAL_EXTERNAL_EPILOGUE], |
| 612 current_.scopes[Scope::EXTERNAL_WEAK_GLOBAL_HANDLES], |
| 599 current_.scopes[Scope::MC_FINISH], current_.scopes[Scope::MC_MARK], | 613 current_.scopes[Scope::MC_FINISH], current_.scopes[Scope::MC_MARK], |
| 600 current_.scopes[Scope::MC_MARK_FINISH_INCREMENTAL], | 614 current_.scopes[Scope::MC_MARK_FINISH_INCREMENTAL], |
| 601 current_.scopes[Scope::MC_MARK_PREPARE_CODE_FLUSH], | 615 current_.scopes[Scope::MC_MARK_PREPARE_CODE_FLUSH], |
| 602 current_.scopes[Scope::MC_MARK_ROOTS], | 616 current_.scopes[Scope::MC_MARK_ROOTS], |
| 603 current_.scopes[Scope::MC_MARK_WEAK_CLOSURE], | 617 current_.scopes[Scope::MC_MARK_WEAK_CLOSURE], |
| 604 current_.scopes[Scope::MC_SWEEP], | 618 current_.scopes[Scope::MC_SWEEP], |
| 605 current_.scopes[Scope::MC_SWEEP_CODE], | 619 current_.scopes[Scope::MC_SWEEP_CODE], |
| 606 current_.scopes[Scope::MC_SWEEP_MAP], | 620 current_.scopes[Scope::MC_SWEEP_MAP], |
| 607 current_.scopes[Scope::MC_SWEEP_OLD], | 621 current_.scopes[Scope::MC_SWEEP_OLD], |
| 608 current_.scopes[Scope::MC_INCREMENTAL_FINALIZE], | 622 current_.scopes[Scope::MC_INCREMENTAL_FINALIZE], |
| (...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 906 | 920 |
| 907 | 921 |
| 908 bool GCTracer::SurvivalEventsRecorded() const { | 922 bool GCTracer::SurvivalEventsRecorded() const { |
| 909 return survival_events_.size() > 0; | 923 return survival_events_.size() > 0; |
| 910 } | 924 } |
| 911 | 925 |
| 912 | 926 |
| 913 void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); } | 927 void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); } |
| 914 } // namespace internal | 928 } // namespace internal |
| 915 } // namespace v8 | 929 } // namespace v8 |
| OLD | NEW |