< prev index next >

src/share/vm/gc/shared/genOopClosures.inline.hpp

Print this page

        

*** 31,53 **** #include "gc/shared/genOopClosures.hpp" #include "gc/shared/generation.hpp" #include "gc/shared/space.hpp" inline OopsInGenClosure::OopsInGenClosure(Generation* gen) : ! ExtendedOopClosure(gen->ref_processor()), _orig_gen(gen), _rs(NULL) { set_generation(gen); } inline void OopsInGenClosure::set_generation(Generation* gen) { _gen = gen; _gen_boundary = _gen->reserved().start(); // Barrier set for the heap, must be set after heap is initialized if (_rs == NULL) { _rs = GenCollectedHeap::heap()->rem_set(); } } template <class T> inline void OopsInGenClosure::do_barrier(T* p) { assert(generation()->is_in_reserved(p), "expected ref in generation"); T heap_oop = oopDesc::load_heap_oop(p); assert(!oopDesc::is_null(heap_oop), "expected non-null oop"); oop obj = oopDesc::decode_heap_oop_not_null(heap_oop); --- 31,58 ---- #include "gc/shared/genOopClosures.hpp" #include "gc/shared/generation.hpp" #include "gc/shared/space.hpp" inline OopsInGenClosure::OopsInGenClosure(Generation* gen) : ! ExtendedOopClosure(gen->ref_processor()), _gen(NULL), _rs(NULL) { set_generation(gen); } inline void OopsInGenClosure::set_generation(Generation* gen) { + assert(_gen == NULL, "Generation already initialized"); _gen = gen; _gen_boundary = _gen->reserved().start(); // Barrier set for the heap, must be set after heap is initialized if (_rs == NULL) { _rs = GenCollectedHeap::heap()->rem_set(); } } + inline void OopsInGenClosure::assert_generation(Generation* gen) { + assert(_gen == gen, "Generations mismatch. Fix it now!!"); + } + template <class T> inline void OopsInGenClosure::do_barrier(T* p) { assert(generation()->is_in_reserved(p), "expected ref in generation"); T heap_oop = oopDesc::load_heap_oop(p); assert(!oopDesc::is_null(heap_oop), "expected non-null oop"); oop obj = oopDesc::decode_heap_oop_not_null(heap_oop);
< prev index next >