Mercurial > hg > truffle
comparison src/share/vm/gc_implementation/parallelScavenge/psMarkSweep.cpp @ 20190:0982ec23da03
8043607: Add a GC id as a log decoration similar to PrintGCTimeStamps
Reviewed-by: jwilhelm, ehelin, tschatzl
author | brutisso |
---|---|
date | Thu, 19 Jun 2014 13:31:14 +0200 |
parents | 78bbf4d43a14 |
children | 2c6ef90f030a |
comparison
equal
deleted
inserted
replaced
20189:5d855d021755 | 20190:0982ec23da03 |
---|---|
167 { | 167 { |
168 HandleMark hm; | 168 HandleMark hm; |
169 | 169 |
170 gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps); | 170 gclog_or_tty->date_stamp(PrintGC && PrintGCDateStamps); |
171 TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); | 171 TraceCPUTime tcpu(PrintGCDetails, true, gclog_or_tty); |
172 GCTraceTime t1(GCCauseString("Full GC", gc_cause), PrintGC, !PrintGCDetails, NULL); | 172 GCTraceTime t1(GCCauseString("Full GC", gc_cause), PrintGC, !PrintGCDetails, NULL, _gc_tracer->gc_id()); |
173 TraceCollectorStats tcs(counters()); | 173 TraceCollectorStats tcs(counters()); |
174 TraceMemoryManagerStats tms(true /* Full GC */,gc_cause); | 174 TraceMemoryManagerStats tms(true /* Full GC */,gc_cause); |
175 | 175 |
176 if (TraceGen1Time) accumulated_time()->start(); | 176 if (TraceGen1Time) accumulated_time()->start(); |
177 | 177 |
511 _objarray_stack.clear(true); | 511 _objarray_stack.clear(true); |
512 } | 512 } |
513 | 513 |
514 void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { | 514 void PSMarkSweep::mark_sweep_phase1(bool clear_all_softrefs) { |
515 // Recursively traverse all live objects and mark them | 515 // Recursively traverse all live objects and mark them |
516 GCTraceTime tm("phase 1", PrintGCDetails && Verbose, true, _gc_timer); | 516 GCTraceTime tm("phase 1", PrintGCDetails && Verbose, true, _gc_timer, _gc_tracer->gc_id()); |
517 trace(" 1"); | 517 trace(" 1"); |
518 | 518 |
519 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); | 519 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); |
520 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); | 520 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); |
521 | 521 |
546 // Process reference objects found during marking | 546 // Process reference objects found during marking |
547 { | 547 { |
548 ref_processor()->setup_policy(clear_all_softrefs); | 548 ref_processor()->setup_policy(clear_all_softrefs); |
549 const ReferenceProcessorStats& stats = | 549 const ReferenceProcessorStats& stats = |
550 ref_processor()->process_discovered_references( | 550 ref_processor()->process_discovered_references( |
551 is_alive_closure(), mark_and_push_closure(), follow_stack_closure(), NULL, _gc_timer); | 551 is_alive_closure(), mark_and_push_closure(), follow_stack_closure(), NULL, _gc_timer, _gc_tracer->gc_id()); |
552 gc_tracer()->report_gc_reference_stats(stats); | 552 gc_tracer()->report_gc_reference_stats(stats); |
553 } | 553 } |
554 | 554 |
555 // This is the point where the entire marking should have completed. | 555 // This is the point where the entire marking should have completed. |
556 assert(_marking_stack.is_empty(), "Marking should have completed"); | 556 assert(_marking_stack.is_empty(), "Marking should have completed"); |
572 _gc_tracer->report_object_count_after_gc(is_alive_closure()); | 572 _gc_tracer->report_object_count_after_gc(is_alive_closure()); |
573 } | 573 } |
574 | 574 |
575 | 575 |
576 void PSMarkSweep::mark_sweep_phase2() { | 576 void PSMarkSweep::mark_sweep_phase2() { |
577 GCTraceTime tm("phase 2", PrintGCDetails && Verbose, true, _gc_timer); | 577 GCTraceTime tm("phase 2", PrintGCDetails && Verbose, true, _gc_timer, _gc_tracer->gc_id()); |
578 trace("2"); | 578 trace("2"); |
579 | 579 |
580 // Now all live objects are marked, compute the new object addresses. | 580 // Now all live objects are marked, compute the new object addresses. |
581 | 581 |
582 // It is not required that we traverse spaces in the same order in | 582 // It is not required that we traverse spaces in the same order in |
602 }; | 602 }; |
603 static PSAlwaysTrueClosure always_true; | 603 static PSAlwaysTrueClosure always_true; |
604 | 604 |
605 void PSMarkSweep::mark_sweep_phase3() { | 605 void PSMarkSweep::mark_sweep_phase3() { |
606 // Adjust the pointers to reflect the new locations | 606 // Adjust the pointers to reflect the new locations |
607 GCTraceTime tm("phase 3", PrintGCDetails && Verbose, true, _gc_timer); | 607 GCTraceTime tm("phase 3", PrintGCDetails && Verbose, true, _gc_timer, _gc_tracer->gc_id()); |
608 trace("3"); | 608 trace("3"); |
609 | 609 |
610 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); | 610 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); |
611 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); | 611 assert(heap->kind() == CollectedHeap::ParallelScavengeHeap, "Sanity"); |
612 | 612 |
645 old_gen->adjust_pointers(); | 645 old_gen->adjust_pointers(); |
646 } | 646 } |
647 | 647 |
648 void PSMarkSweep::mark_sweep_phase4() { | 648 void PSMarkSweep::mark_sweep_phase4() { |
649 EventMark m("4 compact heap"); | 649 EventMark m("4 compact heap"); |
650 GCTraceTime tm("phase 4", PrintGCDetails && Verbose, true, _gc_timer); | 650 GCTraceTime tm("phase 4", PrintGCDetails && Verbose, true, _gc_timer, _gc_tracer->gc_id()); |
651 trace("4"); | 651 trace("4"); |
652 | 652 |
653 // All pointers are now adjusted, move objects accordingly | 653 // All pointers are now adjusted, move objects accordingly |
654 | 654 |
655 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); | 655 ParallelScavengeHeap* heap = (ParallelScavengeHeap*)Universe::heap(); |