Mercurial > hg > graal-compiler
comparison src/share/vm/gc_implementation/g1/concurrentMark.cpp @ 10405:f2110083203d
8005849: JEP 167: Event-Based JVM Tracing
Reviewed-by: acorn, coleenp, sla
Contributed-by: Karen Kinnear <karen.kinnear@oracle.com>, Bengt Rutisson <bengt.rutisson@oracle.com>, Calvin Cheung <calvin.cheung@oracle.com>, Erik Gahlin <erik.gahlin@oracle.com>, Erik Helin <erik.helin@oracle.com>, Jesper Wilhelmsson <jesper.wilhelmsson@oracle.com>, Keith McGuigan <keith.mcguigan@oracle.com>, Mattias Tobiasson <mattias.tobiasson@oracle.com>, Markus Gronlund <markus.gronlund@oracle.com>, Mikael Auno <mikael.auno@oracle.com>, Nils Eliasson <nils.eliasson@oracle.com>, Nils Loodin <nils.loodin@oracle.com>, Rickard Backman <rickard.backman@oracle.com>, Staffan Larsen <staffan.larsen@oracle.com>, Stefan Karlsson <stefan.karlsson@oracle.com>, Yekaterina Kantserova <yekaterina.kantserova@oracle.com>
author | sla |
---|---|
date | Mon, 10 Jun 2013 11:30:51 +0200 |
parents | 05a17f270c7e |
children | 5888334c9c24 |
comparison
equal
deleted
inserted
replaced
10404:d0add7016434 | 10405:f2110083203d |
---|---|
34 #include "gc_implementation/g1/g1RemSet.hpp" | 34 #include "gc_implementation/g1/g1RemSet.hpp" |
35 #include "gc_implementation/g1/heapRegion.inline.hpp" | 35 #include "gc_implementation/g1/heapRegion.inline.hpp" |
36 #include "gc_implementation/g1/heapRegionRemSet.hpp" | 36 #include "gc_implementation/g1/heapRegionRemSet.hpp" |
37 #include "gc_implementation/g1/heapRegionSeq.inline.hpp" | 37 #include "gc_implementation/g1/heapRegionSeq.inline.hpp" |
38 #include "gc_implementation/shared/vmGCOperations.hpp" | 38 #include "gc_implementation/shared/vmGCOperations.hpp" |
39 #include "gc_implementation/shared/gcTimer.hpp" | |
40 #include "gc_implementation/shared/gcTrace.hpp" | |
41 #include "gc_implementation/shared/gcTraceTime.hpp" | |
39 #include "memory/genOopClosures.inline.hpp" | 42 #include "memory/genOopClosures.inline.hpp" |
40 #include "memory/referencePolicy.hpp" | 43 #include "memory/referencePolicy.hpp" |
41 #include "memory/resourceArea.hpp" | 44 #include "memory/resourceArea.hpp" |
42 #include "oops/oop.inline.hpp" | 45 #include "oops/oop.inline.hpp" |
43 #include "runtime/handles.inline.hpp" | 46 #include "runtime/handles.inline.hpp" |
1340 _remark_mark_times.add((mark_work_end - start) * 1000.0); | 1343 _remark_mark_times.add((mark_work_end - start) * 1000.0); |
1341 _remark_weak_ref_times.add((now - mark_work_end) * 1000.0); | 1344 _remark_weak_ref_times.add((now - mark_work_end) * 1000.0); |
1342 _remark_times.add((now - start) * 1000.0); | 1345 _remark_times.add((now - start) * 1000.0); |
1343 | 1346 |
1344 g1p->record_concurrent_mark_remark_end(); | 1347 g1p->record_concurrent_mark_remark_end(); |
1348 | |
1349 G1CMIsAliveClosure is_alive(g1h); | |
1350 g1h->gc_tracer_cm()->report_object_count_after_gc(&is_alive); | |
1345 } | 1351 } |
1346 | 1352 |
1347 // Base class of the closures that finalize and verify the | 1353 // Base class of the closures that finalize and verify the |
1348 // liveness counting data. | 1354 // liveness counting data. |
1349 class CMCountDataClosureBase: public HeapRegionClosure { | 1355 class CMCountDataClosureBase: public HeapRegionClosure { |
2127 Universe::verify(VerifyOption_G1UsePrevMarking, | 2133 Universe::verify(VerifyOption_G1UsePrevMarking, |
2128 " VerifyDuringGC:(after)"); | 2134 " VerifyDuringGC:(after)"); |
2129 } | 2135 } |
2130 | 2136 |
2131 g1h->verify_region_sets_optional(); | 2137 g1h->verify_region_sets_optional(); |
2138 g1h->trace_heap_after_concurrent_cycle(); | |
2132 } | 2139 } |
2133 | 2140 |
2134 void ConcurrentMark::completeCleanup() { | 2141 void ConcurrentMark::completeCleanup() { |
2135 if (has_aborted()) return; | 2142 if (has_aborted()) return; |
2136 | 2143 |
2437 // tables from the displayed time. | 2444 // tables from the displayed time. |
2438 { | 2445 { |
2439 if (G1Log::finer()) { | 2446 if (G1Log::finer()) { |
2440 gclog_or_tty->put(' '); | 2447 gclog_or_tty->put(' '); |
2441 } | 2448 } |
2442 TraceTime t("GC ref-proc", G1Log::finer(), false, gclog_or_tty); | 2449 GCTraceTime t("GC ref-proc", G1Log::finer(), false, g1h->gc_timer_cm()); |
2443 | 2450 |
2444 ReferenceProcessor* rp = g1h->ref_processor_cm(); | 2451 ReferenceProcessor* rp = g1h->ref_processor_cm(); |
2445 | 2452 |
2446 // See the comment in G1CollectedHeap::ref_processing_init() | 2453 // See the comment in G1CollectedHeap::ref_processing_init() |
2447 // about how reference processing currently works in G1. | 2454 // about how reference processing currently works in G1. |
2489 // the number of active workers. This is OK as long as the discovered | 2496 // the number of active workers. This is OK as long as the discovered |
2490 // Reference lists are balanced (see balance_all_queues() and balance_queues()). | 2497 // Reference lists are balanced (see balance_all_queues() and balance_queues()). |
2491 rp->set_active_mt_degree(active_workers); | 2498 rp->set_active_mt_degree(active_workers); |
2492 | 2499 |
2493 // Process the weak references. | 2500 // Process the weak references. |
2494 rp->process_discovered_references(&g1_is_alive, | 2501 const ReferenceProcessorStats& stats = |
2495 &g1_keep_alive, | 2502 rp->process_discovered_references(&g1_is_alive, |
2496 &g1_drain_mark_stack, | 2503 &g1_keep_alive, |
2497 executor); | 2504 &g1_drain_mark_stack, |
2505 executor, | |
2506 g1h->gc_timer_cm()); | |
2507 g1h->gc_tracer_cm()->report_gc_reference_stats(stats); | |
2498 | 2508 |
2499 // The do_oop work routines of the keep_alive and drain_marking_stack | 2509 // The do_oop work routines of the keep_alive and drain_marking_stack |
2500 // oop closures will set the has_overflown flag if we overflow the | 2510 // oop closures will set the has_overflown flag if we overflow the |
2501 // global marking stack. | 2511 // global marking stack. |
2502 | 2512 |
3225 // This can be called either during or outside marking, we'll read | 3235 // This can be called either during or outside marking, we'll read |
3226 // the expected_active value from the SATB queue set. | 3236 // the expected_active value from the SATB queue set. |
3227 satb_mq_set.set_active_all_threads( | 3237 satb_mq_set.set_active_all_threads( |
3228 false, /* new active value */ | 3238 false, /* new active value */ |
3229 satb_mq_set.is_active() /* expected_active */); | 3239 satb_mq_set.is_active() /* expected_active */); |
3240 | |
3241 _g1h->trace_heap_after_concurrent_cycle(); | |
3242 _g1h->register_concurrent_cycle_end(); | |
3230 } | 3243 } |
3231 | 3244 |
3232 static void print_ms_time_info(const char* prefix, const char* name, | 3245 static void print_ms_time_info(const char* prefix, const char* name, |
3233 NumberSeq& ns) { | 3246 NumberSeq& ns) { |
3234 gclog_or_tty->print_cr("%s%5d %12s: total time = %8.2f s (avg = %8.2f ms).", | 3247 gclog_or_tty->print_cr("%s%5d %12s: total time = %8.2f s (avg = %8.2f ms).", |