src/share/vm/memory/cardTableRS.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File
*** old/src/share/vm/memory/cardTableRS.cpp	Fri Oct 17 16:28:39 2014
--- new/src/share/vm/memory/cardTableRS.cpp	Fri Oct 17 16:28:39 2014

*** 54,69 **** --- 54,72 ---- #else _ct_bs = new CardTableModRefBSForCTRS(whole_heap, max_covered_regions); #endif _ct_bs->initialize(); set_bs(_ct_bs); _last_cur_val_in_gen = NEW_C_HEAP_ARRAY3(jbyte, GenCollectedHeap::max_gens + 1, + // max_gens is really GenCollectedHeap::heap()->gen_policy()->number_of_generations() + // (which always is 2), but GenCollectedHeap has not been initialized yet. + int max_gens = 2; + _last_cur_val_in_gen = NEW_C_HEAP_ARRAY3(jbyte, max_gens + 1, mtGC, CURRENT_PC, AllocFailStrategy::RETURN_NULL); if (_last_cur_val_in_gen == NULL) { vm_exit_during_initialization("Could not create last_cur_val_in_gen array."); } - for (int i = 0; i < GenCollectedHeap::max_gens + 1; i++) { _last_cur_val_in_gen[i] = clean_card_val(); } _ct_bs->set_CTRS(this); }
*** 113,123 **** --- 116,126 ---- } } 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); } inline bool ClearNoncleanCardWrapper::clear_card(jbyte* entry) { if (_is_par) {
*** 311,332 **** --- 314,337 ---- #endif _ct_bs->non_clean_card_iterate_possibly_parallel(sp, urasm, cl, this); } 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() // below to avoid missing cards at the fringes. If clear() or // invalidate() are changed in the future, this code should // be revisited. 20040107.ysr clear(old_gen->prev_used_region()); } 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 // of that generation's prev_used_region to determine that // region). No need to do anything for the youngest
*** 388,407 **** --- 393,416 ---- CardTableRS* _ct; public: 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); } }; void CardTableRS::verify_space(Space* s, HeapWord* gen_boundary) { // We don't need to do young-gen spaces. ! if (s->end() <= gen_boundary) return; ! if (s->end() <= gen_boundary) { + return; + } MemRegion used = s->used_region(); jbyte* cur_entry = byte_for(used.start()); jbyte* limit = byte_after(used.last()); while (cur_entry < limit) {

src/share/vm/memory/cardTableRS.cpp
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File