--- old/src/share/vm/memory/cardTableRS.cpp 2014-10-17 16:09:59.000000000 +0200 +++ new/src/share/vm/memory/cardTableRS.cpp 2014-10-17 16:09:59.000000000 +0200 @@ -118,7 +118,7 @@ void CardTableRS::younger_refs_iterate(Generation* g, OopsInGenClosure* blk) { - _last_cur_val_in_gen[g->level()+1] = cur_youngergen_card_val(); + _last_cur_val_in_gen[2 /* Number of generations */] = cur_youngergen_card_val(); g->younger_refs_iterate(blk); } @@ -316,7 +316,8 @@ } void CardTableRS::clear_into_younger(Generation* old_gen) { - assert(old_gen->level() == 1, "Should only be called for the old generation"); + assert(old_gen == GenCollectedHeap::heap()->old_gen(), + "Should only be called for the old generation"); // The card tables for the youngest gen need never be cleared. // There's a bit of subtlety in the clear() and invalidate() // methods that we exploit here and in invalidate_or_clear() @@ -327,7 +328,8 @@ } void CardTableRS::invalidate_or_clear(Generation* old_gen) { - assert(old_gen->level() == 1, "Should only be called for the old generation"); + assert(old_gen == GenCollectedHeap::heap()->old_gen(), + "Should only be called for the old generation"); // Invalidate the cards for the currently occupied part of // the old generation and clear the cards for the // unoccupied part of the generation (if any, making use @@ -393,7 +395,9 @@ VerifyCTGenClosure(CardTableRS* ct) : _ct(ct) {} void do_generation(Generation* gen) { // Skip the youngest generation. - if (gen->level() == 0) return; + if (gen == GenCollectedHeap::heap()->young_gen()) { + return; + } // Normally, we're interested in pointers to younger generations. VerifyCTSpaceClosure blk(_ct, gen->reserved().start()); gen->space_iterate(&blk, true);