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