hotspot/src/share/vm/memory/genCollectedHeap.cpp
changeset 27903 14c6e2f23fa0
parent 27898 813ad96387b3
child 27904 d606512952cc
--- a/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Mon Dec 01 12:11:11 2014 +0100
+++ b/hotspot/src/share/vm/memory/genCollectedHeap.cpp	Tue Dec 02 09:51:16 2014 +0100
@@ -182,7 +182,10 @@
   SharedHeap::post_initialize();
   GenCollectorPolicy *policy = (GenCollectorPolicy *)collector_policy();
   guarantee(policy->is_generation_policy(), "Illegal policy type");
-  DefNewGeneration* def_new_gen = get_gen(0)->as_DefNewGeneration();
+  assert((get_gen(0)->kind() == Generation::DefNew) ||
+         (get_gen(0)->kind() == Generation::ParNew),
+    "Wrong youngest generation type");
+  DefNewGeneration* def_new_gen = (DefNewGeneration*)get_gen(0);
 
   Generation* old_gen = get_gen(1);
   assert(old_gen->kind() == Generation::ConcurrentMarkSweep ||