--- old/src/share/vm/gc/shared/generation.cpp 2015-06-02 19:45:21.000000000 +0200 +++ new/src/share/vm/gc/shared/generation.cpp 2015-06-02 19:45:21.000000000 +0200 @@ -60,7 +60,7 @@ GenerationSpec* Generation::spec() { GenCollectedHeap* gch = GenCollectedHeap::heap(); - if (this == gch->young_gen()) { + if (gch->is_young_gen(this)) { return gch->gen_policy()->young_gen_spec(); } return gch->gen_policy()->old_gen_spec(); @@ -115,7 +115,7 @@ // I didn't want to change the logging when removing the level concept, // but I guess this logging could say young/old or something instead of 0/1. uint level; - if (this == GenCollectedHeap::heap()->young_gen()) { + if (GenCollectedHeap::heap()->is_young_gen(this)) { level = 0; } else { level = 1; @@ -162,7 +162,7 @@ // The largest number of contiguous free words in this or any higher generation. size_t avail = contiguous_available(); size_t old_avail = 0; - if (this == GenCollectedHeap::heap()->young_gen()) { + if (GenCollectedHeap::heap()->is_young_gen(this)) { old_avail = GenCollectedHeap::heap()->old_gen()->contiguous_available(); } return MAX2(avail, old_avail);