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 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 | 394 |
395 void GCTracer::PrintNVP() const { | 395 void GCTracer::PrintNVP() const { |
396 double duration = current_.end_time - current_.start_time; | 396 double duration = current_.end_time - current_.start_time; |
397 double spent_in_mutator = current_.start_time - previous_.end_time; | 397 double spent_in_mutator = current_.start_time - previous_.end_time; |
398 intptr_t allocated_since_last_gc = | 398 intptr_t allocated_since_last_gc = |
399 current_.start_object_size - previous_.end_object_size; | 399 current_.start_object_size - previous_.end_object_size; |
400 | 400 |
401 switch (current_.type) { | 401 switch (current_.type) { |
402 case Event::SCAVENGER: | 402 case Event::SCAVENGER: |
403 PrintIsolate(heap_->isolate(), | 403 PrintIsolate(heap_->isolate(), |
404 "[I:%p] %8.0f ms: " | 404 "%8.0f ms: " |
405 "pause=%.1f " | 405 "pause=%.1f " |
406 "mutator=%.1f " | 406 "mutator=%.1f " |
407 "gc=%s " | 407 "gc=%s " |
408 "reduce_memory=%d " | 408 "reduce_memory=%d " |
409 "scavenge=%.2f " | 409 "scavenge=%.2f " |
410 "old_new=%.2f " | 410 "old_new=%.2f " |
411 "weak=%.2f " | 411 "weak=%.2f " |
412 "roots=%.2f " | 412 "roots=%.2f " |
413 "code=%.2f " | 413 "code=%.2f " |
414 "semispace=%.2f " | 414 "semispace=%.2f " |
415 "object_groups=%.2f " | 415 "object_groups=%.2f " |
416 "steps_count=%d " | 416 "steps_count=%d " |
417 "steps_took=%.1f " | 417 "steps_took=%.1f " |
418 "scavenge_throughput=%" V8_PTR_PREFIX "d " | 418 "scavenge_throughput=%" V8_PTR_PREFIX |
419 "total_size_before=%" V8_PTR_PREFIX "d " | 419 "d " |
420 "total_size_after=%" V8_PTR_PREFIX "d " | 420 "total_size_before=%" V8_PTR_PREFIX |
421 "holes_size_before=%" V8_PTR_PREFIX "d " | 421 "d " |
422 "holes_size_after=%" V8_PTR_PREFIX "d " | 422 "total_size_after=%" V8_PTR_PREFIX |
423 "allocated=%" V8_PTR_PREFIX "d " | 423 "d " |
424 "promoted=%" V8_PTR_PREFIX "d " | 424 "holes_size_before=%" V8_PTR_PREFIX |
425 "semi_space_copied=%" V8_PTR_PREFIX "d " | 425 "d " |
| 426 "holes_size_after=%" V8_PTR_PREFIX |
| 427 "d " |
| 428 "allocated=%" V8_PTR_PREFIX |
| 429 "d " |
| 430 "promoted=%" V8_PTR_PREFIX |
| 431 "d " |
| 432 "semi_space_copied=%" V8_PTR_PREFIX |
| 433 "d " |
426 "nodes_died_in_new=%d " | 434 "nodes_died_in_new=%d " |
427 "nodes_copied_in_new=%d " | 435 "nodes_copied_in_new=%d " |
428 "nodes_promoted=%d " | 436 "nodes_promoted=%d " |
429 "promotion_ratio=%.1f%% " | 437 "promotion_ratio=%.1f%% " |
430 "average_survival_ratio=%.1f%% " | 438 "average_survival_ratio=%.1f%% " |
431 "promotion_rate=%.1f%% " | 439 "promotion_rate=%.1f%% " |
432 "semi_space_copy_rate=%.1f%% " | 440 "semi_space_copy_rate=%.1f%% " |
433 "new_space_allocation_throughput=%" V8_PTR_PREFIX "d " | 441 "new_space_allocation_throughput=%" V8_PTR_PREFIX |
| 442 "d " |
434 "context_disposal_rate=%.1f\n", | 443 "context_disposal_rate=%.1f\n", |
435 heap_->isolate(), | 444 heap_->isolate()->time_millis_since_init(), duration, |
436 heap_->isolate()->time_millis_since_init(), | 445 spent_in_mutator, current_.TypeName(true), |
437 duration, | |
438 spent_in_mutator, | |
439 current_.TypeName(true), | |
440 current_.reduce_memory, | 446 current_.reduce_memory, |
441 current_.scopes[Scope::SCAVENGER_SCAVENGE], | 447 current_.scopes[Scope::SCAVENGER_SCAVENGE], |
442 current_.scopes[Scope::SCAVENGER_OLD_TO_NEW_POINTERS], | 448 current_.scopes[Scope::SCAVENGER_OLD_TO_NEW_POINTERS], |
443 current_.scopes[Scope::SCAVENGER_WEAK], | 449 current_.scopes[Scope::SCAVENGER_WEAK], |
444 current_.scopes[Scope::SCAVENGER_ROOTS], | 450 current_.scopes[Scope::SCAVENGER_ROOTS], |
445 current_.scopes[Scope::SCAVENGER_CODE_FLUSH_CANDIDATES], | 451 current_.scopes[Scope::SCAVENGER_CODE_FLUSH_CANDIDATES], |
446 current_.scopes[Scope::SCAVENGER_SEMISPACE], | 452 current_.scopes[Scope::SCAVENGER_SEMISPACE], |
447 current_.scopes[Scope::SCAVENGER_OBJECT_GROUPS], | 453 current_.scopes[Scope::SCAVENGER_OBJECT_GROUPS], |
448 current_.incremental_marking_steps, | 454 current_.incremental_marking_steps, |
449 current_.incremental_marking_duration, | 455 current_.incremental_marking_duration, |
450 ScavengeSpeedInBytesPerMillisecond(), | 456 ScavengeSpeedInBytesPerMillisecond(), |
451 current_.start_object_size, current_.end_object_size, | 457 current_.start_object_size, current_.end_object_size, |
452 current_.start_holes_size, current_.end_holes_size, | 458 current_.start_holes_size, current_.end_holes_size, |
453 allocated_since_last_gc, heap_->promoted_objects_size(), | 459 allocated_since_last_gc, heap_->promoted_objects_size(), |
454 heap_->semi_space_copied_object_size(), | 460 heap_->semi_space_copied_object_size(), |
455 heap_->nodes_died_in_new_space_, | 461 heap_->nodes_died_in_new_space_, |
456 heap_->nodes_copied_in_new_space_, heap_->nodes_promoted_, | 462 heap_->nodes_copied_in_new_space_, heap_->nodes_promoted_, |
457 heap_->promotion_ratio_, AverageSurvivalRatio(), | 463 heap_->promotion_ratio_, AverageSurvivalRatio(), |
458 heap_->promotion_rate_, heap_->semi_space_copied_rate_, | 464 heap_->promotion_rate_, heap_->semi_space_copied_rate_, |
459 NewSpaceAllocationThroughputInBytesPerMillisecond(), | 465 NewSpaceAllocationThroughputInBytesPerMillisecond(), |
460 ContextDisposalRateInMilliseconds()); | 466 ContextDisposalRateInMilliseconds()); |
461 break; | 467 break; |
462 case Event::MARK_COMPACTOR: | 468 case Event::MARK_COMPACTOR: |
463 case Event::INCREMENTAL_MARK_COMPACTOR: | 469 case Event::INCREMENTAL_MARK_COMPACTOR: |
464 PrintIsolate(heap_->isolate(), | 470 PrintIsolate(heap_->isolate(), |
465 "[I:%p] %8.0f ms: " | 471 "%8.0f ms: " |
466 "pause=%.1f " | 472 "pause=%.1f " |
467 "mutator=%.1f " | 473 "mutator=%.1f " |
468 "gc=%s " | 474 "gc=%s " |
469 "reduce_memory=%d " | 475 "reduce_memory=%d " |
470 "external=%.1f " | 476 "external=%.1f " |
471 "mark=%.1f " | 477 "mark=%.1f " |
472 "mark_inc=%.1f " | 478 "mark_inc=%.1f " |
473 "mark_prepcodeflush=%.1f " | 479 "mark_prepcodeflush=%.1f " |
474 "mark_root=%.1f " | 480 "mark_root=%.1f " |
475 "mark_topopt=%.1f " | 481 "mark_topopt=%.1f " |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
521 "nodes_died_in_new=%d " | 527 "nodes_died_in_new=%d " |
522 "nodes_copied_in_new=%d " | 528 "nodes_copied_in_new=%d " |
523 "nodes_promoted=%d " | 529 "nodes_promoted=%d " |
524 "promotion_ratio=%.1f%% " | 530 "promotion_ratio=%.1f%% " |
525 "average_survival_ratio=%.1f%% " | 531 "average_survival_ratio=%.1f%% " |
526 "promotion_rate=%.1f%% " | 532 "promotion_rate=%.1f%% " |
527 "semi_space_copy_rate=%.1f%% " | 533 "semi_space_copy_rate=%.1f%% " |
528 "new_space_allocation_throughput=%" V8_PTR_PREFIX | 534 "new_space_allocation_throughput=%" V8_PTR_PREFIX |
529 "d " | 535 "d " |
530 "context_disposal_rate=%.1f\n", | 536 "context_disposal_rate=%.1f\n", |
531 heap_->isolate(), heap_->isolate()->time_millis_since_init(), | 537 heap_->isolate()->time_millis_since_init(), duration, |
532 duration, spent_in_mutator, current_.TypeName(true), | 538 spent_in_mutator, current_.TypeName(true), |
533 current_.reduce_memory, current_.scopes[Scope::EXTERNAL], | 539 current_.reduce_memory, current_.scopes[Scope::EXTERNAL], |
534 current_.scopes[Scope::MC_MARK], | 540 current_.scopes[Scope::MC_MARK], |
535 current_.scopes[Scope::MC_MARK_FINISH_INCREMENTAL], | 541 current_.scopes[Scope::MC_MARK_FINISH_INCREMENTAL], |
536 current_.scopes[Scope::MC_MARK_PREPARE_CODE_FLUSH], | 542 current_.scopes[Scope::MC_MARK_PREPARE_CODE_FLUSH], |
537 current_.scopes[Scope::MC_MARK_ROOT], | 543 current_.scopes[Scope::MC_MARK_ROOT], |
538 current_.scopes[Scope::MC_MARK_TOPOPT], | 544 current_.scopes[Scope::MC_MARK_TOPOPT], |
539 current_.scopes[Scope::MC_MARK_RETAIN_MAPS], | 545 current_.scopes[Scope::MC_MARK_RETAIN_MAPS], |
540 current_.scopes[Scope::MC_MARK_WEAK_CLOSURE], | 546 current_.scopes[Scope::MC_MARK_WEAK_CLOSURE], |
541 current_.scopes[Scope::MC_MARK_STRING_TABLE], | 547 current_.scopes[Scope::MC_MARK_STRING_TABLE], |
542 current_.scopes[Scope::MC_MARK_WEAK_REFERENCES], | 548 current_.scopes[Scope::MC_MARK_WEAK_REFERENCES], |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 | 847 |
842 | 848 |
843 bool GCTracer::SurvivalEventsRecorded() const { | 849 bool GCTracer::SurvivalEventsRecorded() const { |
844 return survival_events_.size() > 0; | 850 return survival_events_.size() > 0; |
845 } | 851 } |
846 | 852 |
847 | 853 |
848 void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); } | 854 void GCTracer::ResetSurvivalEvents() { survival_events_.reset(); } |
849 } // namespace internal | 855 } // namespace internal |
850 } // namespace v8 | 856 } // namespace v8 |
OLD | NEW |