src/hotspot/share/gc/cms/cmsHeap.hpp
changeset 50033 000c697c81db
parent 49733 6f0a3ea5ab75
child 50034 01a88f825a84
--- a/src/hotspot/share/gc/cms/cmsHeap.hpp	Mon May 07 14:42:04 2018 +0200
+++ b/src/hotspot/share/gc/cms/cmsHeap.hpp	Mon May 07 14:42:05 2018 +0200
@@ -26,6 +26,7 @@
 #define SHARE_VM_GC_CMS_CMSHEAP_HPP
 
 #include "gc/cms/concurrentMarkSweepGeneration.hpp"
+#include "gc/cms/parNewGeneration.hpp"
 #include "gc/shared/collectedHeap.hpp"
 #include "gc/shared/gcCause.hpp"
 #include "gc/shared/genCollectedHeap.hpp"
@@ -42,10 +43,6 @@
 class WorkGang;
 
 class CMSHeap : public GenCollectedHeap {
-
-protected:
-  virtual void check_gen_kinds();
-
 public:
   CMSHeap(GenCollectorPolicy *policy);
 
@@ -97,6 +94,16 @@
 
   GCMemoryManager* old_manager() const { return _old_manager; }
 
+  ParNewGeneration* young_gen() const {
+    assert(_young_gen->kind() == Generation::ParNew, "Wrong generation type");
+    return static_cast<ParNewGeneration*>(_young_gen);
+  }
+
+  ConcurrentMarkSweepGeneration* old_gen() const {
+    assert(_old_gen->kind() == Generation::ConcurrentMarkSweep, "Wrong generation kind");
+    return static_cast<ConcurrentMarkSweepGeneration*>(_old_gen);
+  }
+
 private:
   WorkGang* _workers;
   MemoryPool* _eden_pool;