comparison src/share/vm/memory/generation.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 8617e38bb4cb
children 71180a6e5080
comparison
equal deleted inserted replaced
10404:d0add7016434 10405:f2110083203d
1 /* 1 /*
2 * Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
21 * questions. 21 * questions.
22 * 22 *
23 */ 23 */
24 24
25 #include "precompiled.hpp" 25 #include "precompiled.hpp"
26 #include "gc_implementation/shared/gcTimer.hpp"
27 #include "gc_implementation/shared/gcTrace.hpp"
26 #include "gc_implementation/shared/spaceDecorator.hpp" 28 #include "gc_implementation/shared/spaceDecorator.hpp"
27 #include "gc_interface/collectedHeap.inline.hpp" 29 #include "gc_interface/collectedHeap.inline.hpp"
28 #include "memory/allocation.inline.hpp" 30 #include "memory/allocation.inline.hpp"
29 #include "memory/blockOffsetTable.inline.hpp" 31 #include "memory/blockOffsetTable.inline.hpp"
30 #include "memory/cardTableRS.hpp" 32 #include "memory/cardTableRS.hpp"
622 624
623 void OneContigSpaceCardGeneration::collect(bool full, 625 void OneContigSpaceCardGeneration::collect(bool full,
624 bool clear_all_soft_refs, 626 bool clear_all_soft_refs,
625 size_t size, 627 size_t size,
626 bool is_tlab) { 628 bool is_tlab) {
629 GenCollectedHeap* gch = GenCollectedHeap::heap();
630
627 SpecializationStats::clear(); 631 SpecializationStats::clear();
628 // Temporarily expand the span of our ref processor, so 632 // Temporarily expand the span of our ref processor, so
629 // refs discovery is over the entire heap, not just this generation 633 // refs discovery is over the entire heap, not just this generation
630 ReferenceProcessorSpanMutator 634 ReferenceProcessorSpanMutator
631 x(ref_processor(), GenCollectedHeap::heap()->reserved_region()); 635 x(ref_processor(), gch->reserved_region());
636
637 STWGCTimer* gc_timer = GenMarkSweep::gc_timer();
638 gc_timer->register_gc_start(os::elapsed_counter());
639
640 SerialOldTracer* gc_tracer = GenMarkSweep::gc_tracer();
641 gc_tracer->report_gc_start(gch->gc_cause(), gc_timer->gc_start());
642
632 GenMarkSweep::invoke_at_safepoint(_level, ref_processor(), clear_all_soft_refs); 643 GenMarkSweep::invoke_at_safepoint(_level, ref_processor(), clear_all_soft_refs);
644
645 gc_timer->register_gc_end(os::elapsed_counter());
646
647 gc_tracer->report_gc_end(os::elapsed_counter(), gc_timer->time_partitions());
648
633 SpecializationStats::print(); 649 SpecializationStats::print();
634 } 650 }
635 651
636 HeapWord* 652 HeapWord*
637 OneContigSpaceCardGeneration::expand_and_allocate(size_t word_size, 653 OneContigSpaceCardGeneration::expand_and_allocate(size_t word_size,