src/hotspot/share/gc/serial/serialHeap.hpp
changeset 50033 000c697c81db
parent 49628 88478047bc8f
child 50034 01a88f825a84
--- a/src/hotspot/share/gc/serial/serialHeap.hpp	Mon May 07 14:42:04 2018 +0200
+++ b/src/hotspot/share/gc/serial/serialHeap.hpp	Mon May 07 14:42:05 2018 +0200
@@ -25,12 +25,15 @@
 #ifndef SHARE_VM_GC_SERIAL_SERIALHEAP_HPP
 #define SHARE_VM_GC_SERIAL_SERIALHEAP_HPP
 
+#include "gc/serial/defNewGeneration.hpp"
+#include "gc/serial/tenuredGeneration.hpp"
 #include "gc/shared/genCollectedHeap.hpp"
 #include "utilities/growableArray.hpp"
 
 class GenCollectorPolicy;
 class GCMemoryManager;
 class MemoryPool;
+class TenuredGeneration;
 
 class SerialHeap : public GenCollectedHeap {
 private:
@@ -40,10 +43,9 @@
 
   virtual void initialize_serviceability();
 
-protected:
-  virtual void check_gen_kinds();
+public:
+  static SerialHeap* heap();
 
-public:
   SerialHeap(GenCollectorPolicy* policy);
 
   virtual Name kind() const {
@@ -61,6 +63,16 @@
   virtual bool is_in_closed_subset(const void* p) const {
     return is_in(p);
   }
+
+  DefNewGeneration* young_gen() const {
+    assert(_young_gen->kind() == Generation::DefNew, "Wrong generation type");
+    return static_cast<DefNewGeneration*>(_young_gen);
+  }
+
+  TenuredGeneration* old_gen() const {
+    assert(_old_gen->kind() == Generation::MarkSweepCompact, "Wrong generation type");
+    return static_cast<TenuredGeneration*>(_old_gen);
+  }
 };
 
 #endif // SHARE_VM_GC_CMS_CMSHEAP_HPP