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, |