8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_SHARED_GENCOLLECTEDHEAP_HPP
26 #define SHARE_VM_GC_SHARED_GENCOLLECTEDHEAP_HPP
27
28 #include "gc/shared/adaptiveSizePolicy.hpp"
29 #include "gc/shared/collectedHeap.hpp"
30 #include "gc/shared/collectorPolicy.hpp"
31 #include "gc/shared/generation.hpp"
32
33 class StrongRootsScope;
34 class SubTasksDone;
35 class WorkGang;
36
37 // A "GenCollectedHeap" is a CollectedHeap that uses generational
38 // collection. It has two generations, young and old.
39 class GenCollectedHeap : public CollectedHeap {
40 friend class GenCollectorPolicy;
41 friend class Generation;
42 friend class DefNewGeneration;
43 friend class TenuredGeneration;
44 friend class ConcurrentMarkSweepGeneration;
45 friend class CMSCollector;
46 friend class GenMarkSweep;
47 friend class VM_GenCollectForAllocation;
482 void prepare_for_compaction();
483
484 // Perform a full collection of the generations up to and including max_generation.
485 // This is the low level interface used by the public versions of
486 // collect() and collect_locked(). Caller holds the Heap_lock on entry.
487 void collect_locked(GCCause::Cause cause, GenerationType max_generation);
488
489 // Returns success or failure.
490 bool create_cms_collector();
491
492 // In support of ExplicitGCInvokesConcurrent functionality
493 bool should_do_concurrent_full_gc(GCCause::Cause cause);
494 void collect_mostly_concurrent(GCCause::Cause cause);
495
496 // Save the tops of the spaces in all generations
497 void record_gen_tops_before_GC() PRODUCT_RETURN;
498
499 protected:
500 void gc_prologue(bool full);
501 void gc_epilogue(bool full);
502 };
503
504 #endif // SHARE_VM_GC_SHARED_GENCOLLECTEDHEAP_HPP
|
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 *
23 */
24
25 #ifndef SHARE_VM_GC_SHARED_GENCOLLECTEDHEAP_HPP
26 #define SHARE_VM_GC_SHARED_GENCOLLECTEDHEAP_HPP
27
28 #include "gc/cms/concurrentMarkSweepThread.hpp"
29 #include "gc/shared/adaptiveSizePolicy.hpp"
30 #include "gc/shared/collectedHeap.hpp"
31 #include "gc/shared/collectorPolicy.hpp"
32 #include "gc/shared/generation.hpp"
33
34 class StrongRootsScope;
35 class SubTasksDone;
36 class WorkGang;
37
38 // A "GenCollectedHeap" is a CollectedHeap that uses generational
39 // collection. It has two generations, young and old.
40 class GenCollectedHeap : public CollectedHeap {
41 friend class GenCollectorPolicy;
42 friend class Generation;
43 friend class DefNewGeneration;
44 friend class TenuredGeneration;
45 friend class ConcurrentMarkSweepGeneration;
46 friend class CMSCollector;
47 friend class GenMarkSweep;
48 friend class VM_GenCollectForAllocation;
483 void prepare_for_compaction();
484
485 // Perform a full collection of the generations up to and including max_generation.
486 // This is the low level interface used by the public versions of
487 // collect() and collect_locked(). Caller holds the Heap_lock on entry.
488 void collect_locked(GCCause::Cause cause, GenerationType max_generation);
489
490 // Returns success or failure.
491 bool create_cms_collector();
492
493 // In support of ExplicitGCInvokesConcurrent functionality
494 bool should_do_concurrent_full_gc(GCCause::Cause cause);
495 void collect_mostly_concurrent(GCCause::Cause cause);
496
497 // Save the tops of the spaces in all generations
498 void record_gen_tops_before_GC() PRODUCT_RETURN;
499
500 protected:
501 void gc_prologue(bool full);
502 void gc_epilogue(bool full);
503
504 public:
505 void stop() {
506 if (UseConcMarkSweepGC) {
507 ConcurrentMarkSweepThread::stop();
508 }
509 }
510 };
511
512 #endif // SHARE_VM_GC_SHARED_GENCOLLECTEDHEAP_HPP
|